Versions in this module Expand all Collapse all v0 v0.1.5 Nov 26, 2025 Changes in this version + const CodeAccountDisabled + const CodeActiveTimeout + const CodeBadRequest + const CodeInvalidParameter + const CodeKickedOut + const CodeMaxLoginCount + const CodeNotFound + const CodeNotLogin + const CodePermissionDenied + const CodeServerError + const CodeSessionError + const CodeStorageError + const CodeSuccess + const CodeTokenExpired + const CodeTokenInvalid + const EventAll + const EventCreateSession + const EventDestroySession + const EventDisable + const EventKickout + const EventLogin + const EventLogout + const EventPermissionCheck + const EventRenew + const EventRoleCheck + const EventUntie + const GrantTypeAuthorizationCode + const GrantTypeClientCredentials + const GrantTypePassword + const GrantTypeRefreshToken + const TokenStyleHash + const TokenStyleJWT + const TokenStyleRandom128 + const TokenStyleRandom32 + const TokenStyleRandom64 + const TokenStyleSimple + const TokenStyleTik + const TokenStyleTimestamp + const TokenStyleUUID + const Version + var Base64Decode = utils.Base64Decode + var Base64Encode = utils.Base64Encode + var ContainsString = utils.ContainsString + var DefaultString = utils.DefaultString + var ErrAccountDisabled = fmt.Errorf("account disabled: this account has been suspended or banned") + var ErrAccountNotFound = fmt.Errorf("account not found: no account associated with this identifier") + var ErrActiveTimeout = fmt.Errorf("session inactive: the session has exceeded the inactivity timeout") + var ErrInvalidDevice = fmt.Errorf("invalid device: the device identifier is not valid") + var ErrInvalidLoginID = fmt.Errorf("invalid login ID: the login identifier cannot be empty") + var ErrKickedOut = fmt.Errorf("kicked out: this session has been forcibly terminated") + var ErrMaxLoginCount = fmt.Errorf("max login limit: maximum number of concurrent logins reached") + var ErrNotLogin = fmt.Errorf("not logged in: authentication required") + var ErrPermissionDenied = fmt.Errorf("permission denied: insufficient permissions") + var ErrRoleDenied = fmt.Errorf("insufficient role: required role not found") + var ErrSessionNotFound = fmt.Errorf("session not found: the session may have expired or been deleted") + var ErrStorageUnavailable = fmt.Errorf("storage unavailable: unable to connect to storage backend") + var ErrTokenExpired = fmt.Errorf("token expired: please login again to get a new token") + var ErrTokenInvalid = fmt.Errorf("invalid token: the token is malformed or corrupted") + var FilterStrings = utils.FilterStrings + var FormatDuration = utils.FormatDuration + var IsEmpty = utils.IsEmpty + var IsNotEmpty = utils.IsNotEmpty + var MapStrings = utils.MapStrings + var MatchPattern = utils.MatchPattern + var MergeStrings = utils.MergeStrings + var ParseDuration = utils.ParseDuration + var RandomAlphanumeric = utils.RandomAlphanumeric + var RandomNumericString = utils.RandomNumericString + var RandomString = utils.RandomString + var RemoveString = utils.RemoveString + var SHA256Hash = utils.SHA256Hash + var UniqueStrings = utils.UniqueStrings + func GetErrorCode(err error) int + func IsAccountDisabledError(err error) bool + func IsNotLoginError(err error) bool + func IsPermissionDeniedError(err error) bool + func IsTokenError(err error) bool + type Builder = builder.Builder + func NewBuilder() *Builder + type Config = config.Config + func DefaultConfig() *Config + type CookieConfig = config.CookieConfig + type Event = listener.Event + type EventData = listener.EventData + type EventListener = listener.Listener + type EventManager = listener.Manager + func NewEventManager() *EventManager + type ListenerConfig = listener.ListenerConfig + type ListenerFunc = listener.ListenerFunc + type Manager = manager.Manager + func NewManager(storage Storage, cfg *Config) *Manager + type NonceManager = security.NonceManager + func NewNonceManager(storage Storage, prefix string, ttl ...int64) *NonceManager + type OAuth2AccessToken = oauth2.AccessToken + type OAuth2Client = oauth2.Client + type OAuth2GrantType = oauth2.GrantType + type OAuth2Server = oauth2.OAuth2Server + func NewOAuth2Server(storage Storage, prefix string) *OAuth2Server + type RefreshTokenInfo = security.RefreshTokenInfo + type RefreshTokenManager = security.RefreshTokenManager + func NewRefreshTokenManager(storage Storage, prefix string, cfg *Config) *RefreshTokenManager + type RequestContext = adapter.RequestContext + type SaTokenContext = context.SaTokenContext + func NewContext(ctx RequestContext, mgr *Manager) *SaTokenContext + type SaTokenError struct + Code int + Context map[string]any + Err error + Message string + func NewAccountDisabledError(loginID string) *SaTokenError + func NewError(code int, message string, err error) *SaTokenError + func NewErrorWithContext(code int, message string, err error, context map[string]any) *SaTokenError + func NewNotLoginError() *SaTokenError + func NewPermissionDeniedError(permission string) *SaTokenError + func NewRoleDeniedError(role string) *SaTokenError + func (e *SaTokenError) Error() string + func (e *SaTokenError) GetContext(key string) (any, bool) + func (e *SaTokenError) Is(target error) bool + func (e *SaTokenError) Unwrap() error + func (e *SaTokenError) WithContext(key string, value any) *SaTokenError + type Session = session.Session + func LoadSession(id string, storage Storage, prefix string) (*Session, error) + func NewSession(id string, storage Storage, prefix string) *Session + type Storage = adapter.Storage + type TokenGenerator = token.Generator + func NewTokenGenerator(cfg *Config) *TokenGenerator + type TokenInfo = manager.TokenInfo + type TokenStyle = config.TokenStyle