Versions in this module Expand all Collapse all v1 v1.0.2 Jul 26, 2026 v1.0.1 Jul 24, 2026 Changes in this version + const DefaultLimit + const DefaultMax + const DefaultPage + var Config = struct{ ... } + func BadRequest(w http.ResponseWriter, message string) + func Conflict(w http.ResponseWriter, message string) + func Forbidden(w http.ResponseWriter, message string) + func InternalError(w http.ResponseWriter, message string) + func JSON[T any](resp Response[T]) ([]byte, error) + func NotFound(w http.ResponseWriter, message string) + func TooManyRequests(w http.ResponseWriter, message string) + func Unauthorized(w http.ResponseWriter, message string) + func UnprocessableEntity(w http.ResponseWriter, message string) + func WriteError(w http.ResponseWriter, status, code int, message string) + func WriteOKMeta[T any](w http.ResponseWriter, data T, meta *Meta) + func WriteOKMsgMeta[T any](w http.ResponseWriter, data T, msg string, meta *Meta) + func WriteOKMsg[T any](w http.ResponseWriter, data T, msg string) + func WriteOK[T any](w http.ResponseWriter, data T) + func Write[T any](w http.ResponseWriter, status int, resp Response[T]) + type Error struct + Code int + Message string + type ListParams struct + func ParseList(q url.Values) ListParams + func ParseListFromRequest(r *http.Request) ListParams + type Meta struct + Page int + PerPage int + TotalCount int64 + TotalPages int + func NewMeta(page, perPage int, totalCount int64) *Meta + type PaginationParams struct + Limit int + MaxLimit int + Page int + func ParsePagination(q url.Values) PaginationParams + func ParsePaginationFromRequest(r *http.Request) PaginationParams + func (p *PaginationParams) GetLimit() int + func (p *PaginationParams) GetOffset() int64 + func (p *PaginationParams) GetPage() int + func (p *PaginationParams) GetSkip() int64 + func (p PaginationParams) WithMaxLimit(max int) PaginationParams + type Response struct + Data T + Error *Error + Meta *Meta + Msg string + Success bool + func Fail(code int, message string) Response[any] + func FailData[T any](code int, message string, data T) Response[T] + func OKMeta[T any](data T, meta *Meta) Response[T] + func OKMsgMeta[T any](data T, msg string, meta *Meta) Response[T] + func OKMsg[T any](data T, msg string) Response[T] + func OK[T any](data T) Response[T] + type SortParams struct + AllowedSortBy []string + DefaultSortBy string + IsDesc bool + Order string + SortBy string + func ParseSort(q url.Values) SortParams + func ParseSortFromRequest(r *http.Request) SortParams + func (p *SortParams) GetOrder() string + func (p *SortParams) GetSortBy() string + func (p *SortParams) IsDescending() bool + func (p SortParams) WithAllowedSort(allowed []string, defaultSort string) SortParams v1.0.0 Jul 23, 2026