entities

package
v0.0.0-...-ca2b8f7 Latest Latest
Warning

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

Go to latest
Published: Nov 6, 2024 License: GPL-3.0 Imports: 12 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

View Source
var (
	ErrUnknownRole         = errors.New("unknown value for credentials_role")
	ErrUnsupportedRoleType = errors.New("unsupported type for credentials_role")
)

Functions

func RegisterRole

func RegisterRole(customValidator *validator.Validate)

func RegisterSortCredentials

func RegisterSortCredentials(customValidator *validator.Validate)

Types

type Credential

type Credential struct {
	bun.BaseModel `bun:"table:credentials,alias:credentials"`

	ID uuid.UUID `bun:"id,pk,type:uuid"`

	Email string `bun:"email"`
	Role  Role   `bun:"role,type:credentials_role"`

	EmailValidationTokenID        string `bun:"email_validation_token_id"`
	PendingEmailValidationTokenID string `bun:"pending_email_validation_token_id"`
	PasswordTokenID               string `bun:"password_token_id"`
	ResetPasswordTokenID          string `bun:"reset_password_token_id"`

	CreatedAt time.Time  `bun:"created_at"`
	UpdatedAt *time.Time `bun:"updated_at"`
}

type Role

type Role string
const (
	RoleNone               Role = ""
	RoleEarlyAccessProgram Role = "early-access-program"
	RoleAdmin              Role = "admin"
	RoleCore               Role = "core"
)

func (*Role) FromString

func (role *Role) FromString(value string) error

func (*Role) Scan

func (role *Role) Scan(src interface{}) (err error)

func (*Role) String

func (role *Role) String() string

func (Role) Value

func (role Role) Value() (driver.Value, error)

type SortCredentials

type SortCredentials string
const (
	SortCredentialsNone      SortCredentials = ""
	SortCredentialsEmail     SortCredentials = "email"
	SortCredentialsRole      SortCredentials = "role"
	SortCredentialsCreatedAt SortCredentials = "created_at"
	SortCredentialsUpdatedAt SortCredentials = "updated_at"
)

Jump to

Keyboard shortcuts

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