model

package
v0.0.0-...-c2c9c91 Latest Latest
Warning

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

Go to latest
Published: Oct 31, 2024 License: MIT Imports: 5 Imported by: 1

Documentation

Index

Constants

View Source
const (
	ErrorEmailConflict = Error("EMAIL_CONFLICT")
	ErrorTokenExpired  = Error("TOKEN_EXPIRED")
	ErrorUserInactive  = Error("USER_INACTIVE")
	ErrorTokenNotFound = Error("TOKEN_NOT_FOUND")
	ErrorUserNotFound  = Error("USER_NOT_FOUND")
)

Variables

This section is empty.

Functions

This section is empty.

Types

type Account

type Account struct {
	ID      ID
	Created Time
	Updated Time
	Name    string
}

type Email

type Email string

func (Email) IsValid

func (e Email) IsValid() bool

func (Email) String

func (e Email) String() string

func (Email) ToLower

func (e Email) ToLower() Email

type Error

type Error string

Error is for errors in the business domain. See the constants below.

func (Error) Error

func (e Error) Error() string

type ID

type ID string

func (ID) String

func (i ID) String() string

type Time

type Time struct {
	T time.Time
}

func Now

func Now() *Time

func ParseTime

func ParseTime(v string) (Time, error)

func (*Time) MarshalText

func (t *Time) MarshalText() ([]byte, error)

func (*Time) Scan

func (t *Time) Scan(src any) error

Scan satisfies sql.Scanner interface.

func (*Time) String

func (t *Time) String() string

func (Time) Value

func (t Time) Value() (driver.Value, error)

Value satisfies driver.Valuer interface.

type User

type User struct {
	ID        ID
	Created   Time
	Updated   Time
	AccountID ID `db:"accountID"`
	Name      string
	Email     Email
	Confirmed bool
	Active    bool
}

Jump to

Keyboard shortcuts

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