config

package
v0.1.18 Latest Latest
Warning

This package is not in the latest version of its module.

Go to latest
Published: Feb 29, 2024 License: MIT Imports: 12 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func GetConnectionStr

func GetConnectionStr() string

func IsSQLiteDialect

func IsSQLiteDialect() bool

func ResetConfig

func ResetConfig(rdbi *DBConfig)

Types

type Config

type Config struct {
	DB *DBConfig
}

func Get

func Get() *Config

Get returns the singleton config for the application

type DBConfig

type DBConfig struct {
	Dialect  string `yaml:"dialect"`
	Database string `yaml:"database"`
	User     string `yaml:"user"`
	Password string `yaml:"password"`
	Host     string `yaml:"host"`
	Port     int    `yaml:"port"`
	Pool     int    `yaml:"pool"`
	SslMode  string `yaml:"sslmode"`
	FilePath string `yaml:"filePath"`
	// contains filtered or unexported fields
}

func (*DBConfig) GetConnectionStr

func (db *DBConfig) GetConnectionStr() string

func (*DBConfig) GetSQLAlchemyDatabaseURIgo

func (db *DBConfig) GetSQLAlchemyDatabaseURIgo() string

func (*DBConfig) Init

func (db *DBConfig) Init() (*sqlx.DB, error)

type Dialect added in v0.1.0

type Dialect string
const (
	SQLite   Dialect = "sqlite"
	Postgres Dialect = "postgres"
)

func GetAllDialects added in v0.1.0

func GetAllDialects() []Dialect

func GetDialect added in v0.1.0

func GetDialect() Dialect

Jump to

Keyboard shortcuts

? : This menu
/ : Search site
f or F : Jump to
y or Y : Canonical URL