Versions in this module Expand all Collapse all v1 v1.0.1 Jul 31, 2025 Changes in this version + type ApiRule struct + Path []string + Rule bool + type Config struct + Delimiter string + Language string + MaxTokens int + TokenRenewTime int64 + type ConfigRaw struct + Delimiter string + Language string + MaxTokens int + TokenRenewTime string + type Group struct + AllowMultipleLogin bool + ApiRules []ApiRule + ExpireSeconds int64 + Name string + type GroupRaw struct + AllowMultipleLogin int + AllowedAPIs string + DeniedAPIs string + ID uint + Name string + TokenExpire string + type IManager interface + AddGroup func(group *GroupRaw) error + AddToken func(userID uint, groupID uint, clientIp string) (string, error) + Auth func(key string, clientIp string, api string) error + BatchAuth func(key string, clientIp string, apis []string) []bool + BatchDeleteExpiredTokens func() error + BatchDeleteTokensByGroupIDs func(groupIDs []uint) error + BatchDeleteTokensByUserIDs func(userIDs []uint) error + CleanExpiredTokens func() + DelGroup func(groupID uint) error + DelToken func(key string) error + DelTokensByGroupID func(groupID uint) error + DelTokensByUserID func(userID uint) error + GenerateToken func() (string, error) + GetGroup func(groupID uint) (*Group, error) + GetStats func() Stats + GetToken func(key string) (*Token[T], error) + GetTokensByGroupID func(groupID uint) []*Token[T] + GetTokensByUserID func(userID uint) []*Token[T] + GetUserData func(key string) (T, error) + SetUserData func(key string, data T) error + UpdateAllGroup func(groups []GroupRaw) error + UpdateGroup func(groupID uint, group *GroupRaw) error + UpdateToken func(key string, token *Token[T]) error + type Stats struct + ActiveTokens int + ExpiredTokens int + LastUpdateTime time.Time + TotalTokens int + type Token struct + ExpireSeconds int64 + GroupID uint + IP string + LastAccessTime time.Time + LoginTime time.Time + UserData T + UserID uint + func (ut *Token[T]) IsExpired() bool