Documentation
¶
Index ¶
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
func GetDatabase ¶
func GetDatabase() (*pg.DB, error)
GetDatabase get a direct connection to the database using the config in viper. Used internally and for the migrate package
Types ¶
type BoxomonDatastore ¶
type BoxomonDatastore struct {
// contains filtered or unexported fields
}
BoxomonDatastore PG-backed implementation of storing messages
func NewDatastoreFromConfig ¶
func NewDatastoreFromConfig() (*BoxomonDatastore, error)
NewDatastoreFromConfig Create and return a datastore using the PG parameters sorted in viper config
func (*BoxomonDatastore) GetEncouragement ¶
func (bdx *BoxomonDatastore) GetEncouragement(ctx context.Context) (*Encouragement, error)
GetEncouragement blah
type DummyBoxomonDatastore ¶
type DummyBoxomonDatastore struct { }
DummyBoxomonDatastore Dummy implementation of the BoxomonDatastore interface
func NewDummyDatastore ¶
func NewDummyDatastore() *DummyBoxomonDatastore
NewDummyDatastore Create and return a dummy datastore
func (*DummyBoxomonDatastore) GetEncouragement ¶
func (dbds *DummyBoxomonDatastore) GetEncouragement(context.Context) (*Encouragement, error)
GetEncouragement Return the same encouragement over and over.
type Encouragement ¶
type Encouragement struct { ID int MessageID int Message Message ImageID int Image Image CreationDate time.Time `pg:"default:now()"` }
Encouragement a combination of message and image to present
Click to show internal directories.
Click to hide internal directories.