Versions in this module Expand all Collapse all v0 v0.1.0 Nov 14, 2026 Changes in this version + const DefaultTake + const HeaderCorrelationID + const HeaderRequestID + const HeaderUser + const MaxTake + var ErrNoUser = errors.New("no user in request") + func WithUser(ctx context.Context, u User) context.Context + type APIError struct + Body string + Envelope ErrorEnvelope + Status int + func (e *APIError) Code() string + func (e *APIError) Conflict() bool + func (e *APIError) Error() string + func (e *APIError) Invalid() bool + func (e *APIError) NotFound() bool + func (e *APIError) Unauthorized() bool + type Direction string + const Asc + const Desc + type Empty struct + type ErrorEnvelope struct + CorrelationID string + Errors []ErrorItem + RequestID string + type ErrorItem struct + Code string + CustomerActions []string + Fields []FieldError + Message string + SupportActions []string + type FieldError struct + Field string + Message string + Rule string + type IDRequest struct + ID int64 + type Page struct + Items []T + Skip int + Take int + Total int64 + func MapPage[A, B any](p Page[A], fn func(A) B) Page[B] + func NewPage[T any](items []T, total int64, req PageRequest) Page[T] + func (p Page[T]) HasMore() bool + type PageRequest struct + Skip int + Take int + func (p PageRequest) Limit() int + func (p PageRequest) Offset() int + type Sort struct + Direction Direction + Field string + type Timestamps struct + CreatedAt time.Time + UpdatedAt time.Time + type UUIDRequest struct + ID string + type User struct + Claims map[string]string + Email string + Features []string + ID int64 + Impersonator *int64 + Name string + Roles []string + Tenant string + func MustUser(ctx context.Context) User + func ParseUser(header string) (User, error) + func UserFrom(ctx context.Context) (User, bool) + func (u User) Can(feature string) bool + func (u User) Has(role string) bool + func (u User) HasAny(roles ...string) bool + func (u User) Header() string + func (u User) Impersonated() bool