Documentation ¶
Index ¶
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
func GroupSuperAdmin ¶
GroupSuperAdmin returns the uuid for the Super Admin
func GroupTitle ¶
GroupTitle return a pretty text name for the group
Types ¶
type GroupMembership ¶
type GroupMembership struct { ID string `validate:"required,ulid" bun:"type:CHAR(26),pk,nullzero,notnull,unique"` CreatedAt time.Time `validate:"-" bun:"type:timestamptz,nullzero,notnull,default:current_timestamp"` UpdatedAt time.Time `validate:"-" bun:"type:timestamptz,nullzero,notnull,default:current_timestamp"` UserID string `validate:"required,ulid" bun:"type:CHAR(26),unique:groupmembership,notnull,nullzero"` User *User `validate:"-" bun:"rel:belongs-to,join:user_id=id"` GroupID uuid.UUID `validate:"required" bun:",unique:groupmembership,notnull,nullzero"` }
GroupMembership represents a user's membership in a group
func (*GroupMembership) BeforeAppendModel ¶ added in v0.0.5
BeforeAppendModel runs before a bun append operation
type User ¶
type User struct { ID string `validate:"required,ulid" bun:"type:CHAR(26),pk,nullzero,notnull,unique"` CreatedAt time.Time `validate:"-" bun:"type:timestamptz,nullzero,notnull,default:current_timestamp"` UpdatedAt time.Time `validate:"-" bun:"type:timestamptz,nullzero,notnull,default:current_timestamp"` Email string `validate:"-" bun:",nullzero,notnull,unique"` EncryptedPassword string `validate:"-" bun:""` SignInCount int `validate:"min=0" bun:",notnull,default:0"` Groups []*GroupMembership `validate:"-" bun:"rel:has-many,join:id=user_id"` Disabled bool `validate:"-" bun:",notnull,default:false"` }
User represents a human user.
func (*User) BeforeAppendModel ¶ added in v0.0.5
BeforeAppendModel runs before a bun append operation
func (*User) CheckPasswordHash ¶
CheckPasswordHash is used to validate that a given password matches the stored hash
func (*User) SetPassword ¶
SetPassword updates the user object's password hash
Click to show internal directories.
Click to hide internal directories.