Documentation
¶
Index ¶
- Variables
- type AuthMode
- type Config
- type Identity
- type IdentityList
- func (s *IdentityList) Append() model.Fielder
- func (s *IdentityList) At(i int) model.Fielder
- func (s *IdentityList) DecodeFields(_ model.FieldReader)
- func (s *IdentityList) EncodeFields(_ model.FieldWriter)
- func (s *IdentityList) IsNil() bool
- func (s *IdentityList) Len() int
- func (s *IdentityList) Pointers() []any
- func (s *IdentityList) Schema() []model.Field
- type LANIP
- type LANIPList
- func (s *LANIPList) Append() model.Fielder
- func (s *LANIPList) At(i int) model.Fielder
- func (s *LANIPList) DecodeFields(_ model.FieldReader)
- func (s *LANIPList) EncodeFields(_ model.FieldWriter)
- func (s *LANIPList) IsNil() bool
- func (s *LANIPList) Len() int
- func (s *LANIPList) Pointers() []any
- func (s *LANIPList) Schema() []model.Field
- type LoginData
- type LoginDataList
- func (s *LoginDataList) Append() model.Fielder
- func (s *LoginDataList) At(i int) model.Fielder
- func (s *LoginDataList) DecodeFields(_ model.FieldReader)
- func (s *LoginDataList) EncodeFields(_ model.FieldWriter)
- func (s *LoginDataList) IsNil() bool
- func (s *LoginDataList) Len() int
- func (s *LoginDataList) Pointers() []any
- func (s *LoginDataList) Schema() []model.Field
- type OAuthProvider
- type OAuthState
- type OAuthStateList
- func (s *OAuthStateList) Append() model.Fielder
- func (s *OAuthStateList) At(i int) model.Fielder
- func (s *OAuthStateList) DecodeFields(_ model.FieldReader)
- func (s *OAuthStateList) EncodeFields(_ model.FieldWriter)
- func (s *OAuthStateList) IsNil() bool
- func (s *OAuthStateList) Len() int
- func (s *OAuthStateList) Pointers() []any
- func (s *OAuthStateList) Schema() []model.Field
- type OAuthUserInfo
- type PasswordData
- type PasswordDataList
- func (s *PasswordDataList) Append() model.Fielder
- func (s *PasswordDataList) At(i int) model.Fielder
- func (s *PasswordDataList) DecodeFields(_ model.FieldReader)
- func (s *PasswordDataList) EncodeFields(_ model.FieldWriter)
- func (s *PasswordDataList) IsNil() bool
- func (s *PasswordDataList) Len() int
- func (s *PasswordDataList) Pointers() []any
- func (s *PasswordDataList) Schema() []model.Field
- type Permission
- type PermissionList
- func (s *PermissionList) Append() model.Fielder
- func (s *PermissionList) At(i int) model.Fielder
- func (s *PermissionList) DecodeFields(_ model.FieldReader)
- func (s *PermissionList) EncodeFields(_ model.FieldWriter)
- func (s *PermissionList) IsNil() bool
- func (s *PermissionList) Len() int
- func (s *PermissionList) Pointers() []any
- func (s *PermissionList) Schema() []model.Field
- type ProfileDTO
- type ProfileData
- type ProfileDataList
- func (s *ProfileDataList) Append() model.Fielder
- func (s *ProfileDataList) At(i int) model.Fielder
- func (s *ProfileDataList) DecodeFields(_ model.FieldReader)
- func (s *ProfileDataList) EncodeFields(_ model.FieldWriter)
- func (s *ProfileDataList) IsNil() bool
- func (s *ProfileDataList) Len() int
- func (s *ProfileDataList) Pointers() []any
- func (s *ProfileDataList) Schema() []model.Field
- type RegisterData
- type RegisterDataList
- func (s *RegisterDataList) Append() model.Fielder
- func (s *RegisterDataList) At(i int) model.Fielder
- func (s *RegisterDataList) DecodeFields(_ model.FieldReader)
- func (s *RegisterDataList) EncodeFields(_ model.FieldWriter)
- func (s *RegisterDataList) IsNil() bool
- func (s *RegisterDataList) Len() int
- func (s *RegisterDataList) Pointers() []any
- func (s *RegisterDataList) Schema() []model.Field
- type Role
- type RoleList
- func (s *RoleList) Append() model.Fielder
- func (s *RoleList) At(i int) model.Fielder
- func (s *RoleList) DecodeFields(_ model.FieldReader)
- func (s *RoleList) EncodeFields(_ model.FieldWriter)
- func (s *RoleList) IsNil() bool
- func (s *RoleList) Len() int
- func (s *RoleList) Pointers() []any
- func (s *RoleList) Schema() []model.Field
- type RolePermission
- func (m *RolePermission) DecodeFields(r model.FieldReader)
- func (m *RolePermission) EncodeFields(w model.FieldWriter)
- func (m *RolePermission) IsNil() bool
- func (m *RolePermission) ModelName() string
- func (m *RolePermission) Pointers() []any
- func (m *RolePermission) Schema() []model.Field
- func (m *RolePermission) SchemaExt() []orm.FieldExt
- type RolePermissionList
- func (s *RolePermissionList) Append() model.Fielder
- func (s *RolePermissionList) At(i int) model.Fielder
- func (s *RolePermissionList) DecodeFields(_ model.FieldReader)
- func (s *RolePermissionList) EncodeFields(_ model.FieldWriter)
- func (s *RolePermissionList) IsNil() bool
- func (s *RolePermissionList) Len() int
- func (s *RolePermissionList) Pointers() []any
- func (s *RolePermissionList) Schema() []model.Field
- type SecurityEvent
- type SecurityEventType
- type Session
- type SessionList
- func (s *SessionList) Append() model.Fielder
- func (s *SessionList) At(i int) model.Fielder
- func (s *SessionList) DecodeFields(_ model.FieldReader)
- func (s *SessionList) EncodeFields(_ model.FieldWriter)
- func (s *SessionList) IsNil() bool
- func (s *SessionList) Len() int
- func (s *SessionList) Pointers() []any
- func (s *SessionList) Schema() []model.Field
- type User
- type UserList
- func (s *UserList) Append() model.Fielder
- func (s *UserList) At(i int) model.Fielder
- func (s *UserList) DecodeFields(_ model.FieldReader)
- func (s *UserList) EncodeFields(_ model.FieldWriter)
- func (s *UserList) IsNil() bool
- func (s *UserList) Len() int
- func (s *UserList) Pointers() []any
- func (s *UserList) Schema() []model.Field
- type UserRole
- type UserRoleList
- func (s *UserRoleList) Append() model.Fielder
- func (s *UserRoleList) At(i int) model.Fielder
- func (s *UserRoleList) DecodeFields(_ model.FieldReader)
- func (s *UserRoleList) EncodeFields(_ model.FieldWriter)
- func (s *UserRoleList) IsNil() bool
- func (s *UserRoleList) Len() int
- func (s *UserRoleList) Pointers() []any
- func (s *UserRoleList) Schema() []model.Field
Constants ¶
This section is empty.
Variables ¶
View Source
var ( ErrInvalidCredentials = fmt.Err("access", "denied") // EN: Access Denied / ES: Acceso Denegado ErrSuspended = fmt.Err("user", "suspended") // EN: User Suspended / ES: Usuario Suspendido ErrEmailTaken = fmt.Err("email", "registered") // EN: Email Registered / ES: Correo electrónico Registrado ErrWeakPassword = fmt.Err("password", "weak") // EN: Password Weak / ES: Contraseña Débil ErrSessionExpired = fmt.Err("token", "expired") // EN: Token Expired / ES: Token Expirado ErrNotFound = fmt.Err("user", "not", "found") // EN: User Not Found / ES: Usuario No Encontrado ErrProviderNotFound = fmt.Err("provider", "not", "found") // EN: Provider Not Found / ES: Proveedor No Encontrado ErrInvalidOAuthState = fmt.Err("state", "invalid") // EN: State Invalid / ES: Estado Inválido ErrCannotUnlink = fmt.Err("identity", "cannot", "unlink") // EN: Identity Cannot Unlink / ES: Identidad No puede Desvincular ErrInvalidRUT = fmt.Err("rut", "invalid") // EN: Rut Invalid / ES: Rut Inválido ErrRUTTaken = fmt.Err("rut", "registered") // EN: Rut Registered / ES: Rut Registrado ErrIPTaken = fmt.Err("ip", "registered") // EN: Ip Registered / ES: Ip Registrado )
View Source
var Identity_ = struct { ID string UserID string Provider string ProviderID string Email string CreatedAt string }{ ID: "id", UserID: "user_id", Provider: "provider", ProviderID: "provider_id", Email: "email", CreatedAt: "created_at", }
View Source
var LANIP_ = struct { ID string UserID string IP string Label string CreatedAt string }{ ID: "id", UserID: "user_id", IP: "ip", Label: "label", CreatedAt: "created_at", }
View Source
var OAuthState_ = struct { State string Provider string ExpiresAt string CreatedAt string }{ State: "state", Provider: "provider", ExpiresAt: "expires_at", CreatedAt: "created_at", }
View Source
var Permission_ = struct { ID string Name string Resource string Action string }{ ID: "id", Name: "name", Resource: "resource", Action: "action", }
View Source
var RolePermission_ = struct { RoleID string PermissionID string }{ RoleID: "role_id", PermissionID: "permission_id", }
View Source
var Role_ = struct { ID string Code string Name string Description string }{ ID: "id", Code: "code", Name: "name", Description: "description", }
View Source
var Session_ = struct { ID string UserID string ExpiresAt string IP string UserAgent string CreatedAt string }{ ID: "id", UserID: "user_id", ExpiresAt: "expires_at", IP: "ip", UserAgent: "user_agent", CreatedAt: "created_at", }
View Source
var UserRole_ = struct { UserID string RoleID string }{ UserID: "user_id", RoleID: "role_id", }
Functions ¶
This section is empty.
Types ¶
type AuthMode ¶ added in v0.0.17
type AuthMode uint8
AuthMode selects the session strategy.
const ( // AuthModeCookie stores a session ID in an HttpOnly cookie. // Stateful: requires user_sessions table. Supports immediate revocation. AuthModeCookie AuthMode = iota // default // AuthModeJWT stores a signed JWT in an HttpOnly cookie. // Stateless: no DB lookup per request. No immediate revocation. // Ideal for SPA/PWA and multi-server deployments. AuthModeJWT // AuthModeBearer reads a signed JWT from the "Authorization: Bearer <token>" header. // Stateless: for API clients (MCP servers, IDEs, LLMs) that cannot use cookies. // Requires JWTSecret. AuthModeBearer )
type Config ¶ added in v0.0.2
type Config struct {
AuthMode AuthMode // default: AuthModeCookie
// Shared by all modes
CookieName string // default: "session"
TokenTTL int // default: 86400 (seconds). Session TTL in cookie mode, JWT expiry in JWT mode.
// Required when AuthMode == AuthModeJWT or AuthMode == AuthModeBearer.
// Also required to call GenerateAPIToken regardless of AuthMode.
JWTSecret []byte
TrustProxy bool
OAuthProviders []OAuthProvider
// Optional hook for receiving security events (e.g. tampering, brute force)
OnSecurityEvent func(SecurityEvent)
// OnPasswordValidate is called by SetPassword before hashing.
// Return a non-nil error to reject the password.
// If nil, only the built-in len >= 8 check applies.
OnPasswordValidate func(password string) error
}
type Identity ¶ added in v0.0.2
type Identity struct {
ID string `db:"pk"`
UserID string `db:"ref=users"`
Provider string
ProviderID string
Email string
CreatedAt int64
}
orm:typed_fields
func ReadOneIdentity ¶ added in v0.0.6
func (*Identity) DecodeFields ¶ added in v0.0.29
func (m *Identity) DecodeFields(r model.FieldReader)
func (*Identity) EncodeFields ¶ added in v0.0.29
func (m *Identity) EncodeFields(w model.FieldWriter)
type IdentityList ¶ added in v0.0.29
type IdentityList []*Identity
func ReadAllIdentity ¶ added in v0.0.6
func ReadAllIdentity(qb *orm.QB) (IdentityList, error)
func (*IdentityList) Append ¶ added in v0.0.29
func (s *IdentityList) Append() model.Fielder
func (*IdentityList) DecodeFields ¶ added in v0.0.29
func (s *IdentityList) DecodeFields(_ model.FieldReader)
func (*IdentityList) EncodeFields ¶ added in v0.0.29
func (s *IdentityList) EncodeFields(_ model.FieldWriter)
func (*IdentityList) IsNil ¶ added in v0.0.29
func (s *IdentityList) IsNil() bool
func (*IdentityList) Len ¶ added in v0.0.29
func (s *IdentityList) Len() int
func (*IdentityList) Pointers ¶ added in v0.0.29
func (s *IdentityList) Pointers() []any
func (*IdentityList) Schema ¶ added in v0.0.29
func (s *IdentityList) Schema() []model.Field
type LANIP ¶ added in v0.0.2
type LANIP struct {
ID string `db:"pk"`
UserID string `db:"ref=users"`
IP string
Label string
CreatedAt int64
}
orm:typed_fields
func (*LANIP) DecodeFields ¶ added in v0.0.29
func (m *LANIP) DecodeFields(r model.FieldReader)
func (*LANIP) EncodeFields ¶ added in v0.0.29
func (m *LANIP) EncodeFields(w model.FieldWriter)
type LANIPList ¶ added in v0.0.29
type LANIPList []*LANIP
func (*LANIPList) DecodeFields ¶ added in v0.0.29
func (s *LANIPList) DecodeFields(_ model.FieldReader)
func (*LANIPList) EncodeFields ¶ added in v0.0.29
func (s *LANIPList) EncodeFields(_ model.FieldWriter)
type LoginData ¶ added in v0.0.2
LoginData is validated by LoginModule on both frontend and backend.
func (*LoginData) DecodeFields ¶ added in v0.0.29
func (m *LoginData) DecodeFields(r model.FieldReader)
func (*LoginData) EncodeFields ¶ added in v0.0.29
func (m *LoginData) EncodeFields(w model.FieldWriter)
type LoginDataList ¶ added in v0.0.29
type LoginDataList []*LoginData
func (*LoginDataList) Append ¶ added in v0.0.29
func (s *LoginDataList) Append() model.Fielder
func (*LoginDataList) DecodeFields ¶ added in v0.0.29
func (s *LoginDataList) DecodeFields(_ model.FieldReader)
func (*LoginDataList) EncodeFields ¶ added in v0.0.29
func (s *LoginDataList) EncodeFields(_ model.FieldWriter)
func (*LoginDataList) IsNil ¶ added in v0.0.29
func (s *LoginDataList) IsNil() bool
func (*LoginDataList) Len ¶ added in v0.0.29
func (s *LoginDataList) Len() int
func (*LoginDataList) Pointers ¶ added in v0.0.29
func (s *LoginDataList) Pointers() []any
func (*LoginDataList) Schema ¶ added in v0.0.29
func (s *LoginDataList) Schema() []model.Field
type OAuthProvider ¶ added in v0.0.2
type OAuthState ¶ added in v0.0.6
orm:typed_fields
func ReadOneOAuthState ¶ added in v0.0.6
func ReadOneOAuthState(qb *orm.QB, model *OAuthState) (*OAuthState, error)
func (*OAuthState) DecodeFields ¶ added in v0.0.29
func (m *OAuthState) DecodeFields(r model.FieldReader)
func (*OAuthState) EncodeFields ¶ added in v0.0.29
func (m *OAuthState) EncodeFields(w model.FieldWriter)
func (*OAuthState) IsNil ¶ added in v0.0.29
func (m *OAuthState) IsNil() bool
func (*OAuthState) ModelName ¶ added in v0.0.29
func (m *OAuthState) ModelName() string
func (*OAuthState) Pointers ¶ added in v0.0.6
func (m *OAuthState) Pointers() []any
func (*OAuthState) Schema ¶ added in v0.0.6
func (m *OAuthState) Schema() []model.Field
type OAuthStateList ¶ added in v0.0.29
type OAuthStateList []*OAuthState
func ReadAllOAuthState ¶ added in v0.0.6
func ReadAllOAuthState(qb *orm.QB) (OAuthStateList, error)
func (*OAuthStateList) Append ¶ added in v0.0.29
func (s *OAuthStateList) Append() model.Fielder
func (*OAuthStateList) DecodeFields ¶ added in v0.0.29
func (s *OAuthStateList) DecodeFields(_ model.FieldReader)
func (*OAuthStateList) EncodeFields ¶ added in v0.0.29
func (s *OAuthStateList) EncodeFields(_ model.FieldWriter)
func (*OAuthStateList) IsNil ¶ added in v0.0.29
func (s *OAuthStateList) IsNil() bool
func (*OAuthStateList) Len ¶ added in v0.0.29
func (s *OAuthStateList) Len() int
func (*OAuthStateList) Pointers ¶ added in v0.0.29
func (s *OAuthStateList) Pointers() []any
func (*OAuthStateList) Schema ¶ added in v0.0.29
func (s *OAuthStateList) Schema() []model.Field
type OAuthUserInfo ¶ added in v0.0.2
type PasswordData ¶ added in v0.0.2
PasswordData is validated by ProfileModule (password change sub-form).
func (*PasswordData) DecodeFields ¶ added in v0.0.29
func (m *PasswordData) DecodeFields(r model.FieldReader)
func (*PasswordData) EncodeFields ¶ added in v0.0.29
func (m *PasswordData) EncodeFields(w model.FieldWriter)
func (*PasswordData) IsNil ¶ added in v0.0.29
func (m *PasswordData) IsNil() bool
func (*PasswordData) ModelName ¶ added in v0.0.29
func (m *PasswordData) ModelName() string
func (*PasswordData) Pointers ¶ added in v0.0.28
func (m *PasswordData) Pointers() []any
func (*PasswordData) Schema ¶ added in v0.0.28
func (m *PasswordData) Schema() []model.Field
type PasswordDataList ¶ added in v0.0.29
type PasswordDataList []*PasswordData
func (*PasswordDataList) Append ¶ added in v0.0.29
func (s *PasswordDataList) Append() model.Fielder
func (*PasswordDataList) DecodeFields ¶ added in v0.0.29
func (s *PasswordDataList) DecodeFields(_ model.FieldReader)
func (*PasswordDataList) EncodeFields ¶ added in v0.0.29
func (s *PasswordDataList) EncodeFields(_ model.FieldWriter)
func (*PasswordDataList) IsNil ¶ added in v0.0.29
func (s *PasswordDataList) IsNil() bool
func (*PasswordDataList) Len ¶ added in v0.0.29
func (s *PasswordDataList) Len() int
func (*PasswordDataList) Pointers ¶ added in v0.0.29
func (s *PasswordDataList) Pointers() []any
func (*PasswordDataList) Schema ¶ added in v0.0.29
func (s *PasswordDataList) Schema() []model.Field
type Permission ¶ added in v0.0.6
orm:typed_fields
func ReadOnePermission ¶ added in v0.0.6
func ReadOnePermission(qb *orm.QB, model *Permission) (*Permission, error)
func (*Permission) DecodeFields ¶ added in v0.0.29
func (m *Permission) DecodeFields(r model.FieldReader)
func (*Permission) EncodeFields ¶ added in v0.0.29
func (m *Permission) EncodeFields(w model.FieldWriter)
func (*Permission) IsNil ¶ added in v0.0.29
func (m *Permission) IsNil() bool
func (*Permission) ModelName ¶ added in v0.0.29
func (m *Permission) ModelName() string
func (*Permission) Pointers ¶ added in v0.0.6
func (m *Permission) Pointers() []any
func (*Permission) Schema ¶ added in v0.0.6
func (m *Permission) Schema() []model.Field
type PermissionList ¶ added in v0.0.29
type PermissionList []*Permission
func ReadAllPermission ¶ added in v0.0.6
func ReadAllPermission(qb *orm.QB) (PermissionList, error)
func (*PermissionList) Append ¶ added in v0.0.29
func (s *PermissionList) Append() model.Fielder
func (*PermissionList) DecodeFields ¶ added in v0.0.29
func (s *PermissionList) DecodeFields(_ model.FieldReader)
func (*PermissionList) EncodeFields ¶ added in v0.0.29
func (s *PermissionList) EncodeFields(_ model.FieldWriter)
func (*PermissionList) IsNil ¶ added in v0.0.29
func (s *PermissionList) IsNil() bool
func (*PermissionList) Len ¶ added in v0.0.29
func (s *PermissionList) Len() int
func (*PermissionList) Pointers ¶ added in v0.0.29
func (s *PermissionList) Pointers() []any
func (*PermissionList) Schema ¶ added in v0.0.29
func (s *PermissionList) Schema() []model.Field
type ProfileDTO ¶ added in v0.0.30
type ProfileDTO struct {
ID string
Name string
Email string
Avatar string
Roles []string
Locale string
}
ProfileDTO is a safe subset of User data for public/API consumption.
func (*ProfileDTO) DecodeFields ¶ added in v0.0.30
func (p *ProfileDTO) DecodeFields(r model.FieldReader)
func (ProfileDTO) EncodeFields ¶ added in v0.0.30
func (p ProfileDTO) EncodeFields(w model.FieldWriter)
func (ProfileDTO) IsNil ¶ added in v0.0.30
func (p ProfileDTO) IsNil() bool
type ProfileData ¶ added in v0.0.2
ProfileData is validated by ProfileModule (name/phone update).
func (*ProfileData) DecodeFields ¶ added in v0.0.29
func (m *ProfileData) DecodeFields(r model.FieldReader)
func (*ProfileData) EncodeFields ¶ added in v0.0.29
func (m *ProfileData) EncodeFields(w model.FieldWriter)
func (*ProfileData) IsNil ¶ added in v0.0.29
func (m *ProfileData) IsNil() bool
func (*ProfileData) ModelName ¶ added in v0.0.29
func (m *ProfileData) ModelName() string
func (*ProfileData) Pointers ¶ added in v0.0.28
func (m *ProfileData) Pointers() []any
func (*ProfileData) Schema ¶ added in v0.0.28
func (m *ProfileData) Schema() []model.Field
type ProfileDataList ¶ added in v0.0.29
type ProfileDataList []*ProfileData
func (*ProfileDataList) Append ¶ added in v0.0.29
func (s *ProfileDataList) Append() model.Fielder
func (*ProfileDataList) DecodeFields ¶ added in v0.0.29
func (s *ProfileDataList) DecodeFields(_ model.FieldReader)
func (*ProfileDataList) EncodeFields ¶ added in v0.0.29
func (s *ProfileDataList) EncodeFields(_ model.FieldWriter)
func (*ProfileDataList) IsNil ¶ added in v0.0.29
func (s *ProfileDataList) IsNil() bool
func (*ProfileDataList) Len ¶ added in v0.0.29
func (s *ProfileDataList) Len() int
func (*ProfileDataList) Pointers ¶ added in v0.0.29
func (s *ProfileDataList) Pointers() []any
func (*ProfileDataList) Schema ¶ added in v0.0.29
func (s *ProfileDataList) Schema() []model.Field
type RegisterData ¶ added in v0.0.2
RegisterData is validated by RegisterModule.
func (*RegisterData) DecodeFields ¶ added in v0.0.29
func (m *RegisterData) DecodeFields(r model.FieldReader)
func (*RegisterData) EncodeFields ¶ added in v0.0.29
func (m *RegisterData) EncodeFields(w model.FieldWriter)
func (*RegisterData) IsNil ¶ added in v0.0.29
func (m *RegisterData) IsNil() bool
func (*RegisterData) ModelName ¶ added in v0.0.29
func (m *RegisterData) ModelName() string
func (*RegisterData) Pointers ¶ added in v0.0.28
func (m *RegisterData) Pointers() []any
func (*RegisterData) Schema ¶ added in v0.0.28
func (m *RegisterData) Schema() []model.Field
type RegisterDataList ¶ added in v0.0.29
type RegisterDataList []*RegisterData
func (*RegisterDataList) Append ¶ added in v0.0.29
func (s *RegisterDataList) Append() model.Fielder
func (*RegisterDataList) DecodeFields ¶ added in v0.0.29
func (s *RegisterDataList) DecodeFields(_ model.FieldReader)
func (*RegisterDataList) EncodeFields ¶ added in v0.0.29
func (s *RegisterDataList) EncodeFields(_ model.FieldWriter)
func (*RegisterDataList) IsNil ¶ added in v0.0.29
func (s *RegisterDataList) IsNil() bool
func (*RegisterDataList) Len ¶ added in v0.0.29
func (s *RegisterDataList) Len() int
func (*RegisterDataList) Pointers ¶ added in v0.0.29
func (s *RegisterDataList) Pointers() []any
func (*RegisterDataList) Schema ¶ added in v0.0.29
func (s *RegisterDataList) Schema() []model.Field
type Role ¶ added in v0.0.6
orm:typed_fields
func (*Role) DecodeFields ¶ added in v0.0.29
func (m *Role) DecodeFields(r model.FieldReader)
func (*Role) EncodeFields ¶ added in v0.0.29
func (m *Role) EncodeFields(w model.FieldWriter)
type RoleList ¶ added in v0.0.29
type RoleList []*Role
func (*RoleList) DecodeFields ¶ added in v0.0.29
func (s *RoleList) DecodeFields(_ model.FieldReader)
func (*RoleList) EncodeFields ¶ added in v0.0.29
func (s *RoleList) EncodeFields(_ model.FieldWriter)
type RolePermission ¶ added in v0.0.6
type RolePermission struct {
RoleID string `db:"pk,ref=roles"`
PermissionID string `db:"pk,ref=permissions"`
}
orm:typed_fields
func ReadOneRolePermission ¶ added in v0.0.6
func ReadOneRolePermission(qb *orm.QB, model *RolePermission) (*RolePermission, error)
func (*RolePermission) DecodeFields ¶ added in v0.0.29
func (m *RolePermission) DecodeFields(r model.FieldReader)
func (*RolePermission) EncodeFields ¶ added in v0.0.29
func (m *RolePermission) EncodeFields(w model.FieldWriter)
func (*RolePermission) IsNil ¶ added in v0.0.29
func (m *RolePermission) IsNil() bool
func (*RolePermission) ModelName ¶ added in v0.0.29
func (m *RolePermission) ModelName() string
func (*RolePermission) Pointers ¶ added in v0.0.6
func (m *RolePermission) Pointers() []any
func (*RolePermission) Schema ¶ added in v0.0.6
func (m *RolePermission) Schema() []model.Field
func (*RolePermission) SchemaExt ¶ added in v0.0.30
func (m *RolePermission) SchemaExt() []orm.FieldExt
type RolePermissionList ¶ added in v0.0.29
type RolePermissionList []*RolePermission
func ReadAllRolePermission ¶ added in v0.0.6
func ReadAllRolePermission(qb *orm.QB) (RolePermissionList, error)
func (*RolePermissionList) Append ¶ added in v0.0.29
func (s *RolePermissionList) Append() model.Fielder
func (*RolePermissionList) At ¶ added in v0.0.29
func (s *RolePermissionList) At(i int) model.Fielder
func (*RolePermissionList) DecodeFields ¶ added in v0.0.29
func (s *RolePermissionList) DecodeFields(_ model.FieldReader)
func (*RolePermissionList) EncodeFields ¶ added in v0.0.29
func (s *RolePermissionList) EncodeFields(_ model.FieldWriter)
func (*RolePermissionList) IsNil ¶ added in v0.0.29
func (s *RolePermissionList) IsNil() bool
func (*RolePermissionList) Len ¶ added in v0.0.29
func (s *RolePermissionList) Len() int
func (*RolePermissionList) Pointers ¶ added in v0.0.29
func (s *RolePermissionList) Pointers() []any
func (*RolePermissionList) Schema ¶ added in v0.0.29
func (s *RolePermissionList) Schema() []model.Field
type SecurityEvent ¶ added in v0.0.22
type SecurityEventType ¶ added in v0.0.22
type SecurityEventType uint8
const ( EventJWTTampered SecurityEventType = iota // ValidateJWT: HMAC mismatch EventOAuthReplay // consumeState: state already consumed (2nd use) EventOAuthExpiredState // consumeState: state found but past ExpiresAt EventOAuthCrossProvider // consumeState: provider mismatch (state preserved) EventIPMismatch // LoginLAN: IP not registered EventNonActiveAccess // Login/LoginLAN: status != "active" EventAccessDenied // AccessCheck: RBAC denied with valid session )
type Session ¶ added in v0.0.2
type Session struct {
ID string `db:"pk"`
UserID string `db:"ref=users"`
ExpiresAt int64
IP string
UserAgent string
CreatedAt int64
}
orm:typed_fields
func ReadOneSession ¶ added in v0.0.6
func (*Session) DecodeFields ¶ added in v0.0.29
func (m *Session) DecodeFields(r model.FieldReader)
func (*Session) EncodeFields ¶ added in v0.0.29
func (m *Session) EncodeFields(w model.FieldWriter)
type SessionList ¶ added in v0.0.29
type SessionList []*Session
func ReadAllSession ¶ added in v0.0.6
func ReadAllSession(qb *orm.QB) (SessionList, error)
func (*SessionList) Append ¶ added in v0.0.29
func (s *SessionList) Append() model.Fielder
func (*SessionList) DecodeFields ¶ added in v0.0.29
func (s *SessionList) DecodeFields(_ model.FieldReader)
func (*SessionList) EncodeFields ¶ added in v0.0.29
func (s *SessionList) EncodeFields(_ model.FieldWriter)
func (*SessionList) IsNil ¶ added in v0.0.29
func (s *SessionList) IsNil() bool
func (*SessionList) Len ¶ added in v0.0.29
func (s *SessionList) Len() int
func (*SessionList) Pointers ¶ added in v0.0.29
func (s *SessionList) Pointers() []any
func (*SessionList) Schema ¶ added in v0.0.29
func (s *SessionList) Schema() []model.Field
type User ¶
type User struct {
ID string `db:"pk"`
Email string `db:"unique"`
Name string
Phone string
Status string // "active", "suspended"
CreatedAt int64
Roles []Role `db:"-"`
Permissions []Permission `db:"-"`
}
orm:typed_fields
func (*User) DecodeFields ¶ added in v0.0.29
func (m *User) DecodeFields(r model.FieldReader)
func (*User) EncodeFields ¶ added in v0.0.29
func (m *User) EncodeFields(w model.FieldWriter)
type UserList ¶ added in v0.0.29
type UserList []*User
func (*UserList) DecodeFields ¶ added in v0.0.29
func (s *UserList) DecodeFields(_ model.FieldReader)
func (*UserList) EncodeFields ¶ added in v0.0.29
func (s *UserList) EncodeFields(_ model.FieldWriter)
type UserRole ¶ added in v0.0.6
orm:typed_fields
func ReadOneUserRole ¶ added in v0.0.6
func (*UserRole) DecodeFields ¶ added in v0.0.29
func (m *UserRole) DecodeFields(r model.FieldReader)
func (*UserRole) EncodeFields ¶ added in v0.0.29
func (m *UserRole) EncodeFields(w model.FieldWriter)
type UserRoleList ¶ added in v0.0.29
type UserRoleList []*UserRole
func ReadAllUserRole ¶ added in v0.0.6
func ReadAllUserRole(qb *orm.QB) (UserRoleList, error)
func (*UserRoleList) Append ¶ added in v0.0.29
func (s *UserRoleList) Append() model.Fielder
func (*UserRoleList) DecodeFields ¶ added in v0.0.29
func (s *UserRoleList) DecodeFields(_ model.FieldReader)
func (*UserRoleList) EncodeFields ¶ added in v0.0.29
func (s *UserRoleList) EncodeFields(_ model.FieldWriter)
func (*UserRoleList) IsNil ¶ added in v0.0.29
func (s *UserRoleList) IsNil() bool
func (*UserRoleList) Len ¶ added in v0.0.29
func (s *UserRoleList) Len() int
func (*UserRoleList) Pointers ¶ added in v0.0.29
func (s *UserRoleList) Pointers() []any
func (*UserRoleList) Schema ¶ added in v0.0.29
func (s *UserRoleList) Schema() []model.Field
Click to show internal directories.
Click to hide internal directories.