Documentation ¶
Index ¶
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
func FindOrCreateTag ¶
FindOrCreateTag returns a models.Tag with the given string, unless there was a database error
func InjectDatabaseMiddleware ¶
func InjectDatabaseMiddleware(db Database) mux.MiddlewareFunc
InjectDatabaseMiddleware is a middleware helper that puts the database connection into the context
func IsRecordNotFoundError ¶
IsRecordNotFoundError is an alias for gorm's IsRecordNotFoundError
Types ¶
type Database ¶
Database represents the database connection For now it is just a type alias for the gorm.DB, but might get additional metadata.
func NewDatabase ¶
NewDatabase returns a new database using the environment variables to figure out where to connect to
Click to show internal directories.
Click to hide internal directories.