sqlite

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: 8 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 struct {
	*SQLitePersist
	// contains filtered or unexported fields
}

func (*Dose) Get

func (d *Dose) Get() *data.Dose

func (*Dose) SetAmount

func (d *Dose) SetAmount(amount int) persistence.Dose

func (*Dose) SetRoute

func (d *Dose) SetRoute(route string) persistence.Dose

func (*Dose) SetSubstance

func (d *Dose) SetSubstance(substance string) persistence.Dose

func (*Dose) SetWhen

func (d *Dose) SetWhen(t time.Time) persistence.Dose

type Doses

type Doses struct {
	*SQLitePersist
	// contains filtered or unexported fields
}

func (*Doses) After

func (d *Doses) After(t time.Time) persistence.Doses

func (*Doses) Before

func (d *Doses) Before(t time.Time) persistence.Doses

func (*Doses) Get

func (d *Doses) Get() []persistence.Dose

func (*Doses) LastX

func (d *Doses) LastX(x uint64) persistence.Doses

func (*Doses) OfSubstance

func (d *Doses) OfSubstance(substance string) persistence.Doses

type SQLitePersist

type SQLitePersist struct {
	// contains filtered or unexported fields
}

func NewPersistor

func NewPersistor(filename string) (persist *SQLitePersist)

func (*SQLitePersist) Authenticate

func (p *SQLitePersist) Authenticate(ld data.LoginData) persistence.Session

func (*SQLitePersist) GetSession

func (p *SQLitePersist) GetSession(token string) persistence.Session

func (*SQLitePersist) GetUser

func (p *SQLitePersist) GetUser(username string) persistence.User

func (*SQLitePersist) InitDB

func (p *SQLitePersist) InitDB()

func (*SQLitePersist) Register

func (p *SQLitePersist) Register(ld data.LoginData, email string) persistence.User

type Session

type Session struct {
	*SQLitePersist
	// contains filtered or unexported fields
}

func (*Session) Get

func (s *Session) Get() *data.Session

func (*Session) Invalidate

func (s *Session) Invalidate()

func (*Session) User

func (s *Session) User() persistence.User

func (*Session) Valid

func (s *Session) Valid() bool

type User

type User struct {
	*SQLitePersist
	// contains filtered or unexported fields
}

func (*User) AddFriend

func (u *User) AddFriend(friend persistence.User) persistence.User

func (*User) ConfirmFriend

func (u *User) ConfirmFriend(friend persistence.User) persistence.User

func (*User) Friends

func (u *User) Friends() []persistence.User

func (*User) Get

func (u *User) Get() *data.User

func (*User) History

func (u *User) History() persistence.Doses

func (*User) Log

func (u *User) Log(substance, route string, dose int, unit string, time time.Time)

func (*User) SetDisplayname

func (u *User) SetDisplayname(displayname string) persistence.User

func (*User) SetEmail

func (u *User) SetEmail(email string) persistence.User

func (*User) SetPassword

func (u *User) SetPassword(password string) persistence.User

func (*User) SetUsername

func (u *User) SetUsername(username string) persistence.User

Jump to

Keyboard shortcuts

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