model

package
v0.0.0-...-eb0b6c1 Latest Latest
Warning

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

Go to latest
Published: Apr 23, 2026 License: MIT Imports: 9 Imported by: 0

Documentation

Index

Constants

View Source
const (
	ErrorEmailConflict = Error("email conflict")
	ErrorTokenExpired  = Error("token expired")
	ErrorTokenNotFound = Error("token not found")
	ErrorUserInactive  = Error("user inactive")
	ErrorUserNotFound  = Error("user not found")
)
View Source
const RFC3339Milli = "2006-01-02T15:04:05.000Z07:00"

RFC3339Milli is like time.RFC3339Nano, but with millisecond precision, and fractional seconds do not have trailing zeros removed. Good for sorting chronologically.

Variables

This section is empty.

Functions

This section is empty.

Types

type AccountID

type AccountID ID

func (AccountID) String

func (i AccountID) String() string

String satisfies fmt.Stringer.

type EmailAddress

type EmailAddress string

func (EmailAddress) IsValid

func (e EmailAddress) IsValid() bool

func (EmailAddress) Local

func (e EmailAddress) Local() string

func (EmailAddress) String

func (e EmailAddress) String() string

func (EmailAddress) ToLower

func (e EmailAddress) ToLower() EmailAddress

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

Error satisfies [error].

type ID

type ID string

func (ID) String

func (i ID) String() string

String satisfies fmt.Stringer.

type Keywords

type Keywords = map[string]string

type Permission

type Permission string

Permission for a user used during authorization.

func (Permission) String

func (p Permission) String() string

String satisfies fmt.Stringer.

type Role

type Role string

Role for a user. A user may have 0 to many of these.

func (Role) Pretty

func (r Role) Pretty() string

Pretty formats the role for display.

func (Role) String

func (r Role) String() string

String satisfies fmt.Stringer.

type Time

type Time struct {
	T time.Time
}

Time is a wrapper around time.Time that provides custom marshaling and scanning. It's useful especially for storing time in SQLite.

func Now

func Now() Time

func ParseTime

func ParseTime(v string) (Time, error)

ParseTime according to RFC3339Milli and return in UTC.

func (*Time) Ago

func (t *Time) Ago() string

func (Time) MarshalText

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

MarshalText satisfies encoding.TextMarshaler.

func (*Time) Pretty

func (t *Time) Pretty() string

func (*Time) Scan

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

Scan satisfies sql.Scanner.

func (Time) String

func (t Time) String() string

String satisfies fmt.Stringer.

func (*Time) UnmarshalText

func (t *Time) UnmarshalText(data []byte) error

UnmarshalText satisfies encoding.TextUnmarshaler.

func (Time) Value

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

Value satisfies driver.Valuer.

type UserID

type UserID ID

func (UserID) String

func (i UserID) String() string

String satisfies fmt.Stringer.

Jump to

Keyboard shortcuts

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