Documentation ¶ Index ¶ func Get(ctx context.Context) *gorm.DB func Open(c Config) (*gorm.DB, error) func Set(ctx context.Context, tx *gorm.DB) context.Context func SetMiddleware(tx *gorm.DB) func(http.Handler) http.Handler type Config type DBType Constants ¶ This section is empty. Variables ¶ This section is empty. Functions ¶ func Get ¶ func Get(ctx context.Context) *gorm.DB func Open ¶ func Open(c Config) (*gorm.DB, error) func Set ¶ func Set(ctx context.Context, tx *gorm.DB) context.Context func SetMiddleware ¶ func SetMiddleware(tx *gorm.DB) func(http.Handler) http.Handler Types ¶ type Config ¶ type Config struct { Type DBType Dsn string Debug bool } type DBType ¶ type DBType string const ( SQLite DBType = "sqlite" MySQL DBType = "mysql" ) Source Files ¶ View all Source files database.go Click to show internal directories. Click to hide internal directories.