Documentation
¶
Index ¶
- type Dose
- type Doses
- type SQLitePersist
- func (p *SQLitePersist) Authenticate(ld data.LoginData) persistence.Session
- func (p *SQLitePersist) GetSession(token string) persistence.Session
- func (p *SQLitePersist) GetUser(username string) persistence.User
- func (p *SQLitePersist) InitDB()
- func (p *SQLitePersist) Register(ld data.LoginData, email string) persistence.User
- type Session
- type User
- func (u *User) AddFriend(friend persistence.User) persistence.User
- func (u *User) ConfirmFriend(friend persistence.User) persistence.User
- func (u *User) Friends() []persistence.User
- func (u *User) Get() *data.User
- func (u *User) History() persistence.Doses
- func (u *User) Log(substance, route string, dose int, unit string, time time.Time)
- func (u *User) SetDisplayname(displayname string) persistence.User
- func (u *User) SetEmail(email string) persistence.User
- func (u *User) SetPassword(password string) persistence.User
- func (u *User) SetUsername(username string) persistence.User
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) SetSubstance ¶
func (d *Dose) SetSubstance(substance string) persistence.Dose
type Doses ¶
type Doses struct {
*SQLitePersist
// contains filtered or unexported fields
}
func (*Doses) Get ¶
func (d *Doses) Get() []persistence.Dose
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) Invalidate ¶
func (s *Session) Invalidate()
func (*Session) User ¶
func (s *Session) User() persistence.User
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) History ¶
func (u *User) History() persistence.Doses
func (*User) SetDisplayname ¶
func (u *User) SetDisplayname(displayname 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
Click to show internal directories.
Click to hide internal directories.