drink

package module
v0.1.1 Latest Latest
Warning

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

Go to latest
Published: Mar 5, 2022 License: Apache-2.0 Imports: 8 Imported by: 0

README

Drink water!

Simple CLI to track your hydration.

Try it

go install github.com/PiotrKozimor/drink/drink@latest
mkdir .drink
drink 240 # ml
drink today
drink all

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func Print

func Print(d []Drink)

func PrintAll

func PrintAll(d []DailyDrinks)

Types

type DailyDrinks

type DailyDrinks struct {
	Drinks []Drink
	Day    time.Time
}

type Drink

type Drink struct {
	HowMuch uint32
	When    time.Time
}

type Store

type Store struct {
	*bbolt.DB
}

func NewStore

func NewStore(path string) (*Store, error)

func (*Store) DrinkIt

func (s *Store) DrinkIt(d *Drink) error

func (*Store) GetAllDrinks

func (s *Store) GetAllDrinks() ([]DailyDrinks, error)

func (*Store) GetTodaysDrinks

func (s *Store) GetTodaysDrinks(when time.Time) ([]Drink, error)

func (*Store) RemoveLastDrink

func (s *Store) RemoveLastDrink() error

Directories

Path Synopsis
cmd

Jump to

Keyboard shortcuts

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