goapi

package
v0.0.0-...-90a23b5 Latest Latest
Warning

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

Go to latest
Published: Mar 28, 2023 License: MIT Imports: 5 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type Account

type Account struct {
	*Model
	FirstName string `db:"first_name"`
	LastName  string `db:"last_name"`
	Gender    *string
	PassHash  string `db:"pass_hash"`
	Email     string
}

Account represents a user account

type Accounts

type Accounts []*Account

type ConfirmEmailRequest

type ConfirmEmailRequest struct {
	ConfirmationKey string
}

type LoginCredentials

type LoginCredentials struct {
	Email    string
	Password string
}

type Model

type Model struct {
	ID          uuid.UUID  `json:"Id"`
	CreatedTime time.Time  `db:"create_time"`
	UpdatedTime *time.Time `db:"update_time"`
}

func NewModel

func NewModel() *Model

type RegisterRequest

type RegisterRequest struct {
	FirstName   string
	LastName    string
	Gender      *string
	PhoneNumber *string
	Email       string
	Password    string
}

func (RegisterRequest) Validate

func (r RegisterRequest) Validate() error

type ResetPasswordRequest

type ResetPasswordRequest struct {
	Email string
}

type Session

type Session struct {
	*Model
	AccountID        int64     `db:"account_id"`
	Token            string    `db:"token"`
	LastActivityTime time.Time `db:"last_activity_time"`
	ExpirationTime   time.Time `db:"expiration_time"`
}

Session represents an account session

func (*Session) Validate

func (s *Session) Validate() error

func (Session) View

func (s Session) View(options map[string]bool) SessionView

type SessionView

type SessionView struct {
	AccountID        int64
	LastActivityTime time.Time
	ExpirationTime   time.Time
}

Jump to

Keyboard shortcuts

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