models

package
v0.0.0-...-a480443 Latest Latest
Warning

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

Go to latest
Published: Jan 2, 2021 License: MIT Imports: 2 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type Passport

type Passport struct {
	ID           string    `json:"id"`
	DateOfIssue  time.Time `json:"dateOfIssue"`
	DateOfExpiry time.Time `json:"dateOfExpiry"`
	Authority    string    `json:"authority"`
	UserID       int       `json:"userId"`
}

Passport holds passport data

func (*Passport) GoString

func (p *Passport) GoString() string

GoString implements the GoStringer interface so we can display the full struct during debugging usage: fmt.Printf("%#v", i) ensure that i is a pointer, so might need to do &i in some cases

type User

type User struct {
	ID              int       `json:"id"`
	FirstName       string    `json:"firstName"`
	LastName        string    `json:"lastName"`
	DateOfBirth     time.Time `json:"dateOfBirth"`
	LocationOfBirth string    `json:"locationOfBirth"`
}

User holds personal user information

func (*User) GoString

func (u *User) GoString() string

GoString implements the GoStringer interface so we can display the full struct during debugging usage: fmt.Printf("%#v", i) ensure that i is a pointer, so might need to do &i in some cases

type UserStorage

type UserStorage interface {
	ListUsers() ([]User, error)
	GetUser(i int) (User, error)
	AddUser(u User) (User, error)
	UpdateUser(u User) (User, error)
	DeleteUser(i int) error
}

UserStorage defines all the database operations

Jump to

Keyboard shortcuts

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