Documentation
¶
Overview ¶
Package types provides all data shapes for the different information used.
Index ¶
Constants ¶
View Source
const UserContextKey = "wits-user"
UserContextKey is the key used to store the user in the context.
View Source
const UserIdKey = "wits-user-id"
UserIdKey is the key used to store the user id in the context.
Variables ¶
This section is empty.
Functions ¶
This section is empty.
Types ¶
type Account ¶
type Account struct {
ID uuid.UUID `bun:"type:uuid,default:uuid_generate_v4()"`
UserID uuid.UUID
Username string
CreatedAt time.Time `bun:",nullzero,notnull,default:current_timestamp"`
UpdatedAt time.Time `bun:",nullzero,notnull,default:current_timestamp"`
}
Account is the type for the account of an authenticated user.
type AuthenticatedUser ¶
type AuthenticatedUser struct {
bun.BaseModel `bun:"auth.users,alias:u"`
ID uuid.UUID `bun:"type:uuid,default:uuid_generate_v4()"`
Email string
Password string
LoggedIn bool `bun:"-"`
CreatedAt time.Time `bun:",nullzero,notnull,default:current_timestamp"`
UpdatedAt time.Time `bun:",nullzero,notnull,default:current_timestamp"`
Account Account
}
AuthenticatedUser represents the wrapper for an authenticated user and their logged-in state, as well as embedding the account.
Click to show internal directories.
Click to hide internal directories.