datastore

package
v0.0.0-...-0701bc4 Latest Latest
Warning

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

Go to latest
Published: Mar 27, 2024 License: AGPL-3.0 Imports: 7 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type Datastore

type Datastore interface {
	CreateHydration(*types.Hydration) error
	GetHydrationByDay(time.Time) ([]types.Hydration, error)

	CreateSleep(*types.Sleep) error
}

type PostgresDatastore

type PostgresDatastore struct {
	Db *gorm.DB
}

func NewPostgresDatastore

func NewPostgresDatastore() *PostgresDatastore

func (*PostgresDatastore) CreateHydration

func (d *PostgresDatastore) CreateHydration(hydration *types.Hydration) error

func (*PostgresDatastore) CreateSleep

func (d *PostgresDatastore) CreateSleep(sleep *types.Sleep) error

func (*PostgresDatastore) GetHydrationByDay

func (d *PostgresDatastore) GetHydrationByDay(day time.Time) ([]types.Hydration, error)

type SqliteDatastore

type SqliteDatastore struct {
	Db *gorm.DB
}

func (*SqliteDatastore) CreateHydration

func (d *SqliteDatastore) CreateHydration(hydration *types.Hydration) error

func (*SqliteDatastore) CreateSleep

func (d *SqliteDatastore) CreateSleep(sleep *types.Sleep) error

func (*SqliteDatastore) GetHydrationByDay

func (d *SqliteDatastore) GetHydrationByDay(day time.Time) ([]types.Hydration, error)

Jump to

Keyboard shortcuts

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