Documentation ¶
Index ¶
Constants ¶
View Source
const ( FilterParamType = "type" SortParam = "time_spent" )
View Source
const ( PaginationParamPage = "page" PaginationParamLimit = "limit" DefaultPage = 1 )
Variables ¶
This section is empty.
Functions ¶
This section is empty.
Types ¶
type ErrWithHint ¶
ErrWithHint custom error for ErrorHandler.
func ErrBadRequestInvalidParameter ¶
func ErrBadRequestInvalidParameter(name string, description ...string) *ErrWithHint
func (ErrWithHint) Error ¶
func (e ErrWithHint) Error() string
func (*ErrWithHint) WithErr ¶
func (e *ErrWithHint) WithErr(err error) *ErrWithHint
type ErrorResponse ¶
ErrorResponse defines the body of an error response.
type Handler ¶
type Handler struct {
// contains filtered or unexported fields
}
func NewHandler ¶
func NewHandler(repo StatementsRepo, maxQueryDuration uint64) *Handler
type Pagination ¶
Pagination used for splitting large data into the small pieces
type Parser ¶
type Parser struct {
// contains filtered or unexported fields
}
func QueryParam ¶
func QueryParam(s QueryGetter) *Parser
func (*Parser) SimplePagination ¶
func (p *Parser) SimplePagination() (SimplePaginationParams, error)
SimplePagination returns SimplePaginationParams from source or parsing error.
type QueryGetter ¶
type ResponseWithPayload ¶
type ResponseWithPayload struct { Message string `json:"message,omitempty"` Pagination Pagination `json:"pagination,omitempty"` Payload interface{} `json:"payload,omitempty"` }
ResponseWithPayload common response with any data in Payload field.
type Server ¶
type Server struct {
// contains filtered or unexported fields
}
Server represents API server of application
type SimplePaginationParams ¶
type StatementsRepo ¶
Click to show internal directories.
Click to hide internal directories.