config

package
v0.0.0-...-dace9ce Latest Latest
Warning

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

Go to latest
Published: Jun 18, 2026 License: GPL-3.0 Imports: 8 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func GetBinFolderPath

func GetBinFolderPath() string

func GetDBFolderPath

func GetDBFolderPath() string

func GetDBPath

func GetDBPath() string

func GetName

func GetName() string

func GetVersion

func GetVersion() string

func IsDBConfigFromEnv

func IsDBConfigFromEnv() bool

func IsDebug

func IsDebug() bool

func SetDBConfig

func SetDBConfig(cfg DBConfig) error

func SetDBFolderPath

func SetDBFolderPath(folderPath string) error

Types

type DBConfig

type DBConfig struct {
	Type     DBType `json:"type" form:"type"`
	Host     string `json:"host" form:"host"`
	Port     int    `json:"port" form:"port"`
	Name     string `json:"name" form:"name"`
	User     string `json:"user" form:"user"`
	Password string `json:"password,omitempty" form:"password"`
	Params   string `json:"params" form:"params"`
	DSN      string `json:"dsn,omitempty" form:"dsn"`
}

func DefaultDBConfig

func DefaultDBConfig() DBConfig

func GetDBConfig

func GetDBConfig() DBConfig

func (DBConfig) IsMySQLCompatible

func (c DBConfig) IsMySQLCompatible() bool

func (DBConfig) IsSQLite

func (c DBConfig) IsSQLite() bool

func (DBConfig) Normalized

func (c DBConfig) Normalized() DBConfig

func (DBConfig) Sanitized

func (c DBConfig) Sanitized() DBConfig

type DBType

type DBType string
const (
	DBTypeSQLite        DBType = "sqlite"
	DBTypeMySQL         DBType = "mysql"
	DBTypeMariaDB       DBType = "mariadb"
	DBTypeMariaDBGalera DBType = "mariadb-galera"
)

type LogLevel

type LogLevel string
const (
	Debug   LogLevel = "debug"
	Info    LogLevel = "info"
	Warning LogLevel = "warning"
	Error   LogLevel = "error"
)

func GetLogLevel

func GetLogLevel() LogLevel

Jump to

Keyboard shortcuts

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