Documentation ¶
Index ¶
- func TotalKcal(reports []Report) uint32
- type DB
- func (d *DB) Close()
- func (d *DB) History(uid int, dates ...time.Time) map[string]uint32
- func (d *DB) LastProducts(n int) []Product
- func (d *DB) Products() []Product
- func (d *DB) SaveProduct(food string, kcal uint32)
- func (d *DB) SaveReport(uid int, r Report)
- func (d *DB) TodayReports(uid int, userTime time.Time) []Report
- func (d *DB) Users() []User
- type Product
- type Report
- type User
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
Types ¶
type DB ¶
type DB struct {
// contains filtered or unexported fields
}
DB stores all bot data.
func (*DB) LastProducts ¶
LastProducts returns n last added products.
func (*DB) SaveProduct ¶
SaveProduct into the database.
func (*DB) SaveReport ¶
SaveReport of the user into the database.
func (*DB) TodayReports ¶
TodayReports of the user.
Click to show internal directories.
Click to hide internal directories.