Versions in this module Expand all Collapse all v0 v0.0.1 May 13, 2023 Changes in this version + func SetHeaderName(name string) + type ContextValue string + var ConnectionContextKey ContextValue = "connection" + var DatabaseContextKey ContextValue = "database" + type DBDriver struct + Database string + Driver Driver + type DBResolver struct + func New(c DatabaseConfig, options ...Option) (*DBResolver, error) + func (resolver *DBResolver) AutoMigrate(models []interface{}, errorCallback func(error) bool) + func (resolver *DBResolver) DB(r *http.Request) *gorm.DB + func (resolver *DBResolver) DBName(r *http.Request) string + func (resolver *DBResolver) Middleware(next http.Handler) http.Handler + type DatabaseConfig map[string]map[string]string + func ConfigFromYAMLFile(filename string) (DatabaseConfig, error) + func ConfigFromYAMLString(yamlStr string) (DatabaseConfig, error) + func (dbconfig DatabaseConfig) DatabaseDrivers() []DBDriver + type Driver string + const MySQL + const Postgres + const Sqlite + type Option func(resolver *DBResolver) + func GormConfig(c *gorm.Config) Option