Documentation
¶
Index ¶
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
This section is empty.
Types ¶
type DB ¶
type DB struct {
// contains filtered or unexported fields
}
DB wrapper for database connection and operations
type Permission ¶
type RolePermission ¶
type Session ¶
type Session struct {
Entity
bun.BaseModel `bun:"table:sessions"`
UserID int64 `bun:"user_id,notnull"`
CreatedAt time.Time `bun:"created_at,notnull,default:current_timestamp"`
ExpiresAt *time.Time `bun:"expires_at"`
UserAgent string `bun:"user_agent,notnull"`
IP string `bun:"ip,notnull"`
LastActivity time.Time `bun:"last_activity,notnull,default:current_timestamp"`
}
type User ¶
type User struct {
Entity
bun.BaseModel `bun:"table:users"`
Name string `bun:"name,notnull"`
Username string `bun:"username,unique"`
PhotoURL *string `bun:"photo_url"`
CreatedAt time.Time `bun:"created_at,notnull,default:current_timestamp"`
IsDeleted bool `bun:"is_deleted,notnull,default:false"`
IsBlocked bool `bun:"is_blocked,notnull,default:false"`
PasswordHash *string `bun:"password_hash"`
Roles []Role `bun:"m2m:user_roles,join:User=Role"`
}
Click to show internal directories.
Click to hide internal directories.