Documentation
¶
Overview ¶
Package store connects to the data store and manages timers and sessions
Index ¶
- type Client
- func (c *Client) DeleteAllTimers() error
- func (c *Client) DeleteSessions(startTimes []time.Time) error
- func (c *Client) DeleteTimer(startTime time.Time) error
- func (c *Client) GetSession(startTime time.Time) (*models.Session, error)
- func (c *Client) GetSessions(since, until time.Time, tags []string) ([]*models.Session, error)
- func (c *Client) Open() error
- func (c *Client) RetrievePausedTimers() ([]*models.Timer, error)
- func (c *Client) UpdateSessions(sessions map[time.Time]*models.Session) error
- func (c *Client) UpdateTimer(timer *models.Timer) error
- type DB
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
This section is empty.
Types ¶
type Client ¶
Client is a BoltDB database client.
func (*Client) DeleteAllTimers ¶ added in v1.4.0
func (*Client) GetSession ¶ added in v1.4.0
func (*Client) GetSessions ¶
func (*Client) RetrievePausedTimers ¶ added in v1.4.0
func (*Client) UpdateSessions ¶ added in v1.4.0
type DB ¶
type DB interface { RetrievePausedTimers() ([]*models.Timer, error) // GetSessions returns saved sessions according to the specified time and tag // constraints GetSessions( since, until time.Time, tags []string, ) ([]*models.Session, error) // UpdateSessions updates one or more Focus sessions. // Each session is created if it doesn't // exist already, or overwritten if it does. UpdateSessions(map[time.Time]*models.Session) error // DeleteSessions deletes one or more saved sessions DeleteSessions(startTimes []time.Time) error // GetSession returns a previously created session. If the session does not // exist, no error is returned. GetSession( startTime time.Time, ) (sess *models.Session, err error) // UpdateTimer stores a timer and the key of an interrupted session UpdateTimer(timer *models.Timer) error // DeleteTimer deletes a previously saved timer if it exists DeleteTimer(startTime time.Time) error // DeleteAllTimers deletes all the saved timers in the database DeleteAllTimers() error // Close ends the database connection Close() error // Open initiates a database connection Open() error }
DB is the database storage interface.
Click to show internal directories.
Click to hide internal directories.