types

package
v0.1.1 Latest Latest
Warning

This package is not in the latest version of its module.

Go to latest
Published: Mar 11, 2025 License: Unlicense Imports: 3 Imported by: 0

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.

Jump to

Keyboard shortcuts

? : This menu
/ : Search site
f or F : Jump to
y or Y : Canonical URL