Versions in this module Expand all Collapse all v0 v0.20.0 Mar 9, 2026 Changes in this version + const AuthStrategyBearer + const AuthStrategyNone + const AuthStrategySignature + const HeaderXAppID + const HeaderXMetaPrefix + const HeaderXNonce + const HeaderXSignature + const HeaderXTimestamp + const VersionV1 + const VersionV2 + const VersionV3 + const VersionV4 + const VersionV5 + const VersionV6 + const VersionV7 + const VersionV8 + const VersionV9 + var ErrEmptyActionName = errors.New("empty action name") + var ErrEmptyResourceName = errors.New("empty resource name") + var ErrInvalidActionName = errors.New("invalid action name format") + var ErrInvalidMetaType = errors.New("invalid meta type: must be pointer to struct") + var ErrInvalidParamsType = errors.New("invalid params type: must be pointer to struct") + var ErrInvalidResourceKind = errors.New("invalid resource kind") + var ErrInvalidResourceName = errors.New("invalid resource name format") + var ErrInvalidVersionFormat = errors.New("invalid version format, must match pattern v+digits (e.g., v1, v2, v10)") + var ErrResourceNameDoubleSlash = errors.New("resource name cannot contain consecutive slashes") + var ErrResourceNameSlash = errors.New("resource name cannot start or end with slash") + func SubscribeAuditEvent(subscriber event.Subscriber, handler func(context.Context, *AuditEvent)) event.UnsubscribeFunc + func ValidateActionName(action string, kind Kind) error + type AuditEvent struct + Action string + ElapsedTime int64 + RequestID string + RequestIP string + RequestMeta map[string]any + RequestParams map[string]any + Resource string + ResultCode int + ResultData any + ResultMessage string + UserAgent string + UserID string + Version string + func NewAuditEvent(params AuditEventParams) *AuditEvent + type AuditEventParams struct + Action string + ElapsedTime int64 + RequestID string + RequestIP string + RequestMeta map[string]any + RequestParams map[string]any + Resource string + ResultCode int + ResultData any + ResultMessage string + UserAgent string + UserID string + Version string + type AuthConfig struct + Options map[string]any + Strategy string + func BearerAuth() *AuthConfig + func Public() *AuthConfig + func SignatureAuth() *AuthConfig + func (c *AuthConfig) Clone() *AuthConfig + type AuthStrategy interface + Authenticate func(ctx fiber.Ctx, options map[string]any) (*security.Principal, error) + Name func() string + type AuthStrategyRegistry interface + Get func(name string) (AuthStrategy, bool) + Names func() []string + Register func(strategy AuthStrategy) + type Engine interface + Lookup func(id Identifier) *Operation + Mount func(router fiber.Router) error + Register func(resources ...Resource) error + type FactoryParamResolver interface + Resolve func() (reflect.Value, error) + Type func() reflect.Type + type HandlerAdapter interface + Adapt func(handler any, op *Operation) (fiber.Handler, error) + type HandlerParamResolver interface + Resolve func(ctx fiber.Ctx) (reflect.Value, error) + Type func() reflect.Type + type HandlerResolver interface + Resolve func(resource Resource, spec OperationSpec) (any, error) + type Identifier struct + Action string + Resource string + Version string + func (id Identifier) String() string + type Kind uint8 + const KindREST + const KindRPC + func (k Kind) String() string + type M struct + type Meta map[string]any + func (m Meta) Decode(out any) error + type Middleware interface + Name func() string + Order func() int + Process func(ctx fiber.Ctx) error + type Operation struct + Auth *AuthConfig + Dynamic bool + EnableAudit bool + Handler any + Meta map[string]any + RateLimit *RateLimitConfig + Timeout time.Duration + func (o *Operation) HasRateLimit() bool + func (o *Operation) RequiresAuth() bool + type OperationSpec struct + Action string + EnableAudit bool + Handler any + PermToken string + Public bool + RateLimit *RateLimitConfig + Timeout time.Duration + type OperationsCollector interface + Collect func(resource Resource) []OperationSpec + type OperationsProvider interface + Provide func() []OperationSpec + type P struct + type Params map[string]any + func (p Params) Decode(out any) error + type RateLimitConfig struct + Key string + Max int + Period time.Duration + type Request struct + Meta Meta + Params Params + func (r *Request) GetMeta(key string) (any, bool) + func (r *Request) GetParam(key string) (any, bool) + type Resource interface + Auth func() *AuthConfig + Kind func() Kind + Name func() string + Operations func() []OperationSpec + Version func() string + func NewRESTResource(name string, opts ...ResourceOption) Resource + func NewRPCResource(name string, opts ...ResourceOption) Resource + type ResourceOption func(*baseResource) + func WithAuth(auth *AuthConfig) ResourceOption + func WithOperations(ops ...OperationSpec) ResourceOption + func WithVersion(v string) ResourceOption + type RouterStrategy interface + CanHandle func(kind Kind) bool + Name func() string + Route func(handler fiber.Handler, op *Operation) + Setup func(router fiber.Router) error