Documentation ¶
Overview ¶
Package database defines method for interacting with PostgreSQL for persistent data.
Index ¶
- type DB
- func (db DB) DeleteReadings(core string, start, end time.Time) error
- func (db DB) GetLatestReadings(userEmail string) ([]models.Reading, error)
- func (db DB) GetReadings(core string, start, end time.Time) ([]models.Reading, error)
- func (db DB) GetSecret(userEmail string) (secret models.Secret, err error)
- func (db DB) GetUser(email string) (models.User, error)
- func (db DB) StoreReading(reading models.Reading) error
- func (db DB) StoreSecret(userEmail string, secret models.Secret) error
- func (db DB) StoreUser(user models.User) error
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
This section is empty.
Types ¶
type DB ¶
DB is a type used by external packages to implement database operations. DB should be initialized via DBConn function.
func (DB) DeleteReadings ¶
DeleteReadings deletes readings within a specified time span from the database
func (DB) GetLatestReadings ¶
GetLatestReadings retrieves the latest readings for a particular user from the database.
func (DB) GetReadings ¶
GetReadings gets readings within a specified time span from the database
func (DB) StoreReading ¶
StoreReading stores a new reading in the database
func (DB) StoreSecret ¶
StoreSecret updates the specified user's secret in the database
Click to show internal directories.
Click to hide internal directories.