persistence

package
v0.0.0-...-f826577 Latest Latest
Warning

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

Go to latest
Published: May 28, 2021 License: AGPL-3.0 Imports: 2 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type Dose

type Dose interface {
	Get() *data.Dose
	SetWhen(t time.Time) Dose
	SetAmount(amount int) Dose
	SetSubstance(substance string) Dose
	SetRoute(route string) Dose
}

type Doses

type Doses interface {
	Before(t time.Time) Doses
	After(t time.Time) Doses
	OfSubstance(substance string) Doses
	LastX(x uint64) Doses
	Get() []Dose
}

type Persistor

type Persistor interface {
	Authenticate(ld data.LoginData) Session
	Register(ld data.LoginData, email string) User
	GetSession(token string) Session
	GetUser(username string) User
}

type Session

type Session interface {
	Get() *data.Session
	User() User
	Valid() bool
	Invalidate()
}

type User

type User interface {
	Get() *data.User
	SetUsername(username string) User
	SetEmail(email string) User
	SetDisplayname(displayname string) User
	SetPassword(password string) User
	AddFriend(friend User) User
	ConfirmFriend(friend User) User
	Friends() []User
	History() Doses
	Log(substance string, route string, dose int, unit string, time time.Time)
}

Directories

Path Synopsis

Jump to

Keyboard shortcuts

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