Versions in this module Expand all Collapse all v1 v1.0.0 Mar 21, 2026 Changes in this version + func GetUserIDFromContext(ctx context.Context) (string, bool) + func GetUserIDFromRequest(req *http.Request) (string, bool) + func NewContextWithRequestContext(ctx context.Context, rc *RequestContext) context.Context + func SetRequestContext(ctx context.Context, rc *RequestContext) context.Context + type Account struct + AccessToken *string + AccessTokenExpiresAt *time.Time + AccountID string + CreatedAt time.Time + ID string + IDToken *string + Password *string + ProviderID string + RefreshToken *string + RefreshTokenExpiresAt *time.Time + Scope *string + UpdatedAt time.Time + User User + UserID string + type AccountDatabaseHooksConfig struct + AfterCreate func(account Account) error + AfterUpdate func(account Account) error + BeforeCreate func(account *Account) error + BeforeUpdate func(account *Account) error + type AuthMethodProvider interface + AuthMiddleware func() func(http.Handler) http.Handler + OptionalAuthMiddleware func() func(http.Handler) http.Handler + type AuthProviderID string + const AuthProviderDiscord + const AuthProviderEmail + const AuthProviderGitHub + const AuthProviderGoogle + const AuthProviderMagicLink + func (id AuthProviderID) String() string + type CORSConfig struct + AllowCredentials bool + AllowedHeaders []string + AllowedMethods []string + AllowedOrigins []string + ExposedHeaders []string + MaxAge time.Duration + type Config struct + AppName string + BasePath string + BaseURL string + CoreDatabaseHooks *CoreDatabaseHooksConfig + Database DatabaseConfig + EventBus EventBusConfig + Logger LoggerConfig + Plugins PluginsConfig + PreParsedConfigs map[string]any + RouteMappings []RouteMapping + Secret string + Security SecurityConfig + Session SessionConfig + Verification VerificationConfig + type ConfigManager interface + GetConfig func() *Config + Init func() error + Load func() error + Update func(key string, value any) error + UpdateWithResult func(key string, value any, result **Config) error + Watch func(ctx context.Context) (<-chan *Config, error) + type ContextKey string + const ContextAuthIdempotentSkipTokensMint + const ContextAuthSignOut + const ContextAuthSuccess + const ContextRequestContext + const ContextSessionID + const ContextSessionToken + const ContextUserID + func (k ContextKey) String() string + type CoreDatabaseHooksConfig struct + Accounts *AccountDatabaseHooksConfig + Sessions *SessionDatabaseHooksConfig + Users *UserDatabaseHooksConfig + Verifications *VerificationDatabaseHooksConfig + type CoreSystem interface + Close func() error + Init func(ctx context.Context) error + Name func() string + type DatabaseConfig struct + ConnMaxLifetime time.Duration + MaxIdleConns int + MaxOpenConns int + Provider string + URL string + type Event struct + ID string + Metadata map[string]string + Payload json.RawMessage + Timestamp time.Time + Type string + type EventBus interface + type EventBusConfig struct + GoChannel *GoChannelConfig + Kafka *KafkaConfig + MaxConcurrentHandlers int + NATS *NatsConfig + PostgreSQL *PostgreSQLConfig + Prefix string + Provider events.EventBusProvider + RabbitMQ *RabbitMQConfig + Redis *RedisConfig + SQLite *SQLiteConfig + type EventHandler func(ctx context.Context, event Event) error + type EventPublisher interface + Close func() error + Publish func(ctx context.Context, event Event) error + type EventSubscriber interface + Close func() error + Subscribe func(eventType string, handler EventHandler) (SubscriptionID, error) + Unsubscribe func(eventType string, id SubscriptionID) + type GoChannelConfig struct + BufferSize int + type Hook struct + Async bool + Handler HookHandler + Matcher HookMatcher + Order int + PluginID string + Stage HookStage + type HookHandler func(reqCtx *RequestContext) error + type HookMatcher func(reqCtx *RequestContext) bool + type HookStage int + const HookAfter + const HookBefore + const HookOnRequest + const HookOnResponse + type KafkaConfig struct + Brokers string + ConsumerGroup string + type Logger interface + Debug func(msg string, args ...any) + Error func(msg string, args ...any) + Info func(msg string, args ...any) + Warn func(msg string, args ...any) + type LoggerConfig struct + Level string + type Message struct + Metadata map[string]string + Payload []byte + UUID string + type MiddlewareProvider interface + Middleware func() func(http.Handler) http.Handler + type NatsConfig struct + URL string + type Plugin interface + Close func() error + Config func() any + Init func(ctx *PluginContext) error + Metadata func() PluginMetadata + type PluginContext struct + DB bun.IDB + EventBus EventBus + GetConfig func() *Config + Logger Logger + ServiceRegistry ServiceRegistry + type PluginID string + const PluginAccessControl + const PluginAdmin + const PluginBearer + const PluginCSRF + const PluginConfigManager + const PluginEmail + const PluginEmailPassword + const PluginJWT + const PluginMagicLink + const PluginOAuth2 + const PluginRateLimit + const PluginSecondaryStorage + const PluginSession + const PluginTOTP + func (id PluginID) String() string + type PluginMetadata struct + Description string + ID string + Version string + type PluginOption func(p Plugin) + type PluginRegistry interface + CloseAll func() + DropMigrations func(ctx context.Context) error + GetConfig func() *Config + GetPlugin func(pluginID string) Plugin + InitAll func() error + Plugins func() []Plugin + Register func(p Plugin) error + RunMigrations func(ctx context.Context) error + type PluginWithConfigWatcher interface + OnConfigUpdate func(config *Config) error + type PluginWithHooks interface + Hooks func() []Hook + type PluginWithMiddleware interface + Middleware func() []func(http.Handler) http.Handler + type PluginWithMigrations interface + DependsOn func() []string + Migrations func(provider string) []migrations.Migration + type PluginWithRoutes interface + Routes func() []Route + type PluginsConfig map[string]any + type PostgreSQLConfig struct + URL string + type PubSub interface + Close func() error + Publish func(ctx context.Context, topic string, msg *Message) error + Subscribe func(ctx context.Context, topic string) (<-chan *Message, error) + type RabbitMQConfig struct + URL string + type RedisConfig struct + ConsumerGroup string + URL string + type RequestContext struct + ClientIP string + Handled bool + Headers http.Header + Method string + Path string + RedirectURL string + Request *http.Request + ResponseBody []byte + ResponseData any + ResponseHeaders http.Header + ResponseReady bool + ResponseStatus int + ResponseWriter http.ResponseWriter + Route *Route + UserID *string + Values map[string]any + func GetRequestContext(ctx context.Context) (*RequestContext, bool) + func (reqCtx *RequestContext) SetJSONResponse(status int, payload any) + func (reqCtx *RequestContext) SetResponse(status int, headers http.Header, body []byte) + func (reqCtx *RequestContext) SetUserIDInContext(userID string) + type Route struct + Handler http.Handler + Metadata map[string]any + Method string + Middleware []func(http.Handler) http.Handler + Path string + type RouteGroup struct + Metadata map[string]any + Path string + Routes []Route + type RouteMapping struct + Method string + Path string + Permissions []string + Plugins []string + type SQLiteConfig struct + DBPath string + type SecondaryStorage interface + Close func() error + Delete func(ctx context.Context, key string) error + Get func(ctx context.Context, key string) (any, error) + Incr func(ctx context.Context, key string, ttl *time.Duration) (int, error) + Set func(ctx context.Context, key string, value any, ttl *time.Duration) error + TTL func(ctx context.Context, key string) (*time.Duration, error) + type SecondaryStorageType string + const SecondaryStorageTypeCustom + const SecondaryStorageTypeDatabase + const SecondaryStorageTypeMemory + type SecurityConfig struct + CORS CORSConfig + TrustedHeaders []string + TrustedOrigins []string + TrustedProxies []string + type ServiceID string + const ServiceAccount + const ServiceAdmin + const ServiceConfigManager + const ServiceJWT + const ServiceMailer + const ServicePassword + const ServiceSecondaryStorage + const ServiceSession + const ServiceToken + const ServiceUser + const ServiceVerification + func (id ServiceID) String() string + type ServiceRegistry interface + Get func(name string) any + Register func(name string, service any) + type Session struct + CreatedAt time.Time + ExpiresAt time.Time + ID string + IPAddress *string + Token string + UpdatedAt time.Time + User User + UserAgent *string + UserID string + type SessionConfig struct + AutoCleanup bool + CleanupInterval time.Duration + CookieMaxAge time.Duration + CookieName string + ExpiresIn time.Duration + HttpOnly bool + MaxSessionsPerUser int + SameSite string + Secure bool + UpdateAge time.Duration + type SessionDatabaseHooksConfig struct + AfterCreate func(session Session) error + AfterUpdate func(session Session) error + BeforeCreate func(session *Session) error + BeforeUpdate func(session *Session) error + type SocialProviderConfig struct + ClientID string + ClientSecret string + Enabled bool + RedirectURL string + Scopes []string + type SubscriptionID uint64 + type User struct + CreatedAt time.Time + Email string + EmailVerified bool + ID string + Image *string + Metadata json.RawMessage + Name string + UpdatedAt time.Time + func (u *User) BeforeAppendModel(ctx context.Context, query bun.Query) error + type UserDatabaseHooksConfig struct + AfterCreate func(user User) error + AfterUpdate func(user User) error + BeforeCreate func(user *User) error + BeforeUpdate func(user *User) error + type Verification struct + CreatedAt time.Time + ExpiresAt time.Time + ID string + Identifier string + Token string + Type VerificationType + UpdatedAt time.Time + User *User + UserID *string + type VerificationConfig struct + AutoCleanup bool + CleanupInterval time.Duration + type VerificationDatabaseHooksConfig struct + AfterCreate func(verification Verification) error + BeforeCreate func(verification *Verification) error + type VerificationType string + const TypeEmailResetRequest + const TypeEmailVerification + const TypeMagicLinkExchangeCode + const TypeMagicLinkSignInRequest + const TypePasswordResetRequest + const TypeTOTPPendingAuth + func (vt VerificationType) String() string