Versions in this module Expand all Collapse all v1 v1.3.0 Oct 23, 2026 Changes in this version + const EventEmailVerified + const EventPasswordChanged + const EventSessionCreated + const EventSessionRevoked + const EventUserCreated + const EventUserSignedIn + const EventUserSignedOut + var ErrAdapterNotConfigured = errors.New("sdk db: adapter not configured") + var ErrDuplicate = errors.New("plugin-sdk: duplicate registration") + var ErrNotFound = errors.New("plugin-sdk: not found") + var ErrPluginDependency = errors.New("plugin-sdk: dependency error") + func Adapt(m Module) auth.PluginModule + func Provide[T any](ctx *Context, impl T) error + type Context struct + func NewContext(host *auth.Host) *Context + func NewTestContext(ad adapter.Adapter, c cache.Cache, em email.Sender) *Context + func (c *Context) Adapter() adapter.Adapter + func (c *Context) Cache() cache.Cache + func (c *Context) Core() *auth.Auth + func (c *Context) DB() *DB + func (c *Context) Email() email.Sender + func (c *Context) Events() *auth.Events + func (c *Context) Get(key string) (any, bool) + func (c *Context) Hooks() *auth.Hooks + func (c *Context) Host() *auth.Host + func (c *Context) Logger() *slog.Logger + func (c *Context) ModuleID() string + func (c *Context) Now() time.Time + func (c *Context) Schema() *schema.Schema + func (c *Context) Set(key string, val any) + func (c *Context) StandardContext() context.Context + func (c *Context) Store() store.Store + type DB struct + func (db *DB) Adapter() adapter.Adapter + type Dependent interface + Dependencies func() []string + type Error struct + Err error + Kind ErrorKind + Message string + func NewError(kind ErrorKind, message string, err error) *Error + func (e *Error) Error() string + func (e *Error) Unwrap() error + type ErrorKind int + const KindConflict + const KindForbidden + const KindInternal + const KindNotFound + const KindUnauthorized + const KindUnknown + const KindValidation + func (k ErrorKind) String() string + type Event = auth.Event + type EventHandler = auth.EventHandler + type EventName = auth.EventName + type HTTPClient interface + Do func(req *http.Request) (*http.Response, error) + type HookFunc func(ctx context.Context, payload T) error + type HookRegistry struct + func NewHookRegistry[T any]() *HookRegistry[T] + func (r *HookRegistry[T]) Execute(ctx context.Context, payload T) error + func (r *HookRegistry[T]) Register(fn HookFunc[T]) + type Hooks = auth.Hooks + type Lifecycle = auth.Lifecycle + type Migration struct + Description string + Down func(ctx context.Context) error + Up func(ctx context.Context) error + Version int + type MigrationProvider interface + Migrations func() []Migration + type Module interface + ID func() string + Init func(ctx *Context) error + func ResolveInitOrder(modules []Module) ([]Module, error) + type Repository struct + func For[T any](db *DB, modelName string) *Repository[T] + func FromAdapter[T any](a adapter.Adapter, modelName string) *Repository[T] + func Model[T any](c *Context, modelName string) *Repository[T] + func (r *Repository[T]) Count(ctx context.Context, where ...adapter.Condition) (int64, error) + func (r *Repository[T]) Create(ctx context.Context, entity *T) error + func (r *Repository[T]) Delete(ctx context.Context, where ...adapter.Condition) (int64, error) + func (r *Repository[T]) FindMany(ctx context.Context, q adapter.Query) ([]T, error) + func (r *Repository[T]) FindOne(ctx context.Context, where ...adapter.Condition) (*T, error) + func (r *Repository[T]) Update(ctx context.Context, where []adapter.Condition, update map[string]any) (int64, error)