store

package
v0.0.0-...-6d93e11 Latest Latest
Warning

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

Go to latest
Published: Jun 13, 2022 License: MIT Imports: 10 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func AddUser

func AddUser(user *User) error

func GenerateSalt

func GenerateSalt() ([]byte, error)

func GetDBConnection

func GetDBConnection() *pg.DB

func SetDBConnection

func SetDBConnection(dbOpts *pg.Options)

Types

type User

type User struct {
	ID             int
	Username       string `binding:"required,min=3,max=30"`
	Password       string `pg:"-" binding:"required,min=7,max=30"`
	HashedPassword []byte `json:"-"`
	Salt           []byte `json:"-"`
	Cookies        int
	LastClaimed    time.Time
	CreatedAt      time.Time
	ModifiedAt     time.Time
}

func AddCookies

func AddCookies(id int, newCookies int) (*User, error)

func Authenticate

func Authenticate(username, password string) (*User, error)

func FetchUser

func FetchUser(id int) (*User, error)

Jump to

Keyboard shortcuts

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