Documentation ¶
Index ¶
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
This section is empty.
Types ¶
type DBPostgreSQLConfig ¶
type DBPostgreSQLConfig struct { Host string `json:"host,omitempty" env:"DB_HOST" envDefault:"0.0.0.0"` Port int `json:"port,omitempty" env:"DB_PORT" envDefault:"5432"` User string `json:"user,omitempty" env:"DB_USER" envDefault:"guest"` Password string `json:"password,omitempty" env:"DB_PASSWORD" envDefault:""` DBName string `json:"dbname,omitempty" env:"DB_NAME" envDefault:"go-clean"` }
func NewDBPostgreSQLConfigFromEnv ¶
func NewDBPostgreSQLConfigFromEnv() (*DBPostgreSQLConfig, error)
func (*DBPostgreSQLConfig) ConnectionString ¶
func (c *DBPostgreSQLConfig) ConnectionString() string
func (*DBPostgreSQLConfig) Dialect ¶
func (c *DBPostgreSQLConfig) Dialect() string
func (*DBPostgreSQLConfig) Import ¶
func (c *DBPostgreSQLConfig) Import() error
type DBSQLiteConfig ¶
type DBSQLiteConfig struct {
Path string `json:"path,omitempty" env:"DB_FILE_PATH"`
}
func NewDBSQLiteConfig ¶
func NewDBSQLiteConfig() (*DBSQLiteConfig, error)
func (*DBSQLiteConfig) ConnectionString ¶
func (c *DBSQLiteConfig) ConnectionString() string
func (*DBSQLiteConfig) Dialect ¶
func (c *DBSQLiteConfig) Dialect() string
func (*DBSQLiteConfig) Import ¶
func (c *DBSQLiteConfig) Import() error
type Session ¶
TODO: Gorm field is a public property - this is not ISP 👎
func NewSession ¶
func (*Session) BeginTransaction ¶
func (*Session) DefferWithRollback ¶
func (s *Session) DefferWithRollback()
Click to show internal directories.
Click to hide internal directories.