Versions in this module Expand all Collapse all v0 v0.6.0 Dec 20, 2022 v0.4.0 Oct 13, 2022 Changes in this version + type Algorithm struct + Name string + Private string + Public string + Type string + type Options struct + AccessExpires int + Algorithms []*Algorithm + RefreshExpires int + URLPrefix string + func (o *Options) SanitizeConfig() *app.ConfigError v0.3.0 Oct 8, 2022 Changes in this version type Admin + func (m *Admin) OnLogin(f func(int64)) (int, error) + func (m *Admin) OnLogout(f func(int64)) (int, error) + func (m *Admin) RegisterSetting(uid int64, v any, id string, title, desc web.LocaleStringer, ...) (*setting.Group, error) + type ModelAdmin struct + Avatar string + Created time.Time + ID int64 + Name string + Nickname string + Sex Sex + State State + Super bool + Username string + XMLName struct{} + func (*ModelAdmin) TableName() string + func (a *ModelAdmin) BeforeInsert() error + func (a *ModelAdmin) BeforeUpdate() error v0.2.0 Sep 19, 2022 v0.1.0 Sep 3, 2022 Changes in this version + const SystemID + var SexRule = web.NewRuleFunc(locales.InvalidValue, SexValidator) + var StateRule = web.NewRuleFunc(locales.InvalidValue, StateValidator) + func Install(mod *web.Module, db *orm.DB) + func SexValidator(v any) bool + func StateValidator(v any) bool + type Admin struct + func New(mod *web.Module, db *orm.DB, urlPrefix string, tokenCfg *token.Config, ...) (*Admin, error) + func (m *Admin) AddSecurityLog(uid int64, content, ip, ua string) error + func (m *Admin) AddSecurityLogWithContext(uid int64, ctx *web.Context, content string) + func (m *Admin) AuthFilter(next web.HandlerFunc) web.HandlerFunc + func (m *Admin) IsAllowChangeGroup(ctx *web.Context, groups types.SliceOf[int64]) (bool, error) + func (m *Admin) LoginUser(ctx *web.Context) *modelAdmin + func (m *Admin) RBACFilter(mod *web.Module, res string, next web.HandlerFunc) web.HandlerFunc + func (m *Admin) RegisterResources(mod *web.Module, res map[string]web.LocaleStringer) error + func (m *Admin) URLPrefix() string + type Sex int8 + const SexFemale + const SexMale + const SexUnknown + func ParseSex(v string) (Sex, error) + func (s *Sex) UnmarshalText(p []byte) error + func (s Sex) IsValid() bool + func (s Sex) MarshalText() ([]byte, error) + func (s Sex) String() string + type State int8 + const StateLeft + const StateLocked + const StateNormal + func ParseState(v string) (State, error) + func (s *State) UnmarshalText(p []byte) error + func (s State) IsValid() bool + func (s State) MarshalText() ([]byte, error) + func (s State) String() string