Documentation
¶
Index ¶
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
This section is empty.
Types ¶
type AccountService ¶
type AccountService interface {
Create(ctx context.Context, userID string, accountID string, providerID string, password *string) (*models.Account, error)
CreateOAuth2(ctx context.Context, userID string, providerAccountID string, provider string, accessToken string, refreshToken *string, accessTokenExpiresAt *time.Time, refreshTokenExpiresAt *time.Time, scope *string) (*models.Account, error)
GetByUserID(ctx context.Context, userID string) (*models.Account, error)
GetByUserIDAndProvider(ctx context.Context, userID string, provider string) (*models.Account, error)
GetByProviderAndAccountID(ctx context.Context, provider string, accountID string) (*models.Account, error)
Update(ctx context.Context, account *models.Account) (*models.Account, error)
UpdateFields(ctx context.Context, userID string, fields map[string]any) error
}
type ConfigManagerService ¶
type ConfigManagerService interface {
GetConfig(ctx context.Context) (*models.Config, error)
GetAuthSettings(ctx context.Context) (map[string]any, error)
GetPluginConfig(ctx context.Context, pluginName string) (any, error)
RegisterConfigWatcher(pluginID string, plugin models.PluginWithConfigWatcher) error
NotifyWatchers(config *models.Config) error
}
type CoreServices ¶
type CoreServices struct {
UserService UserService
AccountService AccountService
SessionService SessionService
VerificationService VerificationService
TokenService TokenService
}
type JWTService ¶
type MailerService ¶
type PasswordService ¶
type SecondaryStorageService ¶
type SecondaryStorageService interface {
// GetStorage returns the configured SecondaryStorage backend
GetStorage() models.SecondaryStorage
// GetProviderName returns the name of the currently active provider (e.g., "redis", "database", "memory")
GetProviderName() string
}
SecondaryStorageService provides access to the configured secondary storage backend
type SessionService ¶
type SessionService interface {
GetByID(ctx context.Context, id string) (*models.Session, error)
Create(ctx context.Context, userID string, hashedToken string, ipAddress *string, userAgent *string, maxAge time.Duration) (*models.Session, error)
GetByUserID(ctx context.Context, userID string) (*models.Session, error)
GetByToken(ctx context.Context, hashedToken string) (*models.Session, error)
Update(ctx context.Context, session *models.Session) (*models.Session, error)
Delete(ctx context.Context, ID string) error
DeleteAllByUserID(ctx context.Context, userID string) error
}
type TokenService ¶
type UserService ¶
type UserService interface {
Create(ctx context.Context, name string, email string, emailVerified bool, image *string) (*models.User, error)
GetByID(ctx context.Context, id string) (*models.User, error)
GetByEmail(ctx context.Context, email string) (*models.User, error)
Update(ctx context.Context, user *models.User) (*models.User, error)
UpdateFields(ctx context.Context, id string, fields map[string]any) error
}
type VerificationService ¶
type VerificationService interface {
Create(ctx context.Context, userID string, hashedToken string, vType models.VerificationType, value string, expiry time.Duration) (*models.Verification, error)
GetByToken(ctx context.Context, hashedToken string) (*models.Verification, error)
Delete(ctx context.Context, id string) error
DeleteByUserIDAndType(ctx context.Context, userID string, vType models.VerificationType) error
IsExpired(verif *models.Verification) bool
}
Click to show internal directories.
Click to hide internal directories.