conf

package
v0.0.0-...-b1757e7 Latest Latest
Warning

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

Go to latest
Published: Jul 2, 2024 License: MIT Imports: 7 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func LoadConfigFromEnv

func LoadConfigFromEnv() error

func LoadConfigFromToml

func LoadConfigFromToml(filepath string) error

Types

type App

type App struct {
	HttpHost string `json:"http_host" env:"HTTP_HOST"`
	HttpPort int64  `json:"http_port" env:"HTTP_PORT"`
}

func (*App) HttpAddress

func (a *App) HttpAddress() string

type Config

type Config struct {
	MySQL *MySQL `json:"mysql"`

	App *App `json:"app"`
}

func C

func C() *Config

func ConfigFromEnv

func ConfigFromEnv() *Config

func DefaultConfig

func DefaultConfig() *Config

config for the backend

func (*Config) String

func (c *Config) String() string

type MySQL

type MySQL struct {
	Host     string `json:"host" toml:"host" env:"MYSQL_HOST"`
	Port     int    `json:"port" toml:"port" env:"MYSQL_PORT"`
	DB       string `json:"database" toml:"database" env:"MYSQL_DB"`
	Username string `json:"username" toml:"username" env:"MYSQL_USERNAME"`
	Password string `json:"password" toml:"password" env:"MYSQL_PASSWORD"`
	// contains filtered or unexported fields
}

func (*MySQL) GetConn

func (m *MySQL) GetConn() *gorm.DB

func (*MySQL) GetDSN

func (m *MySQL) GetDSN() string

Jump to

Keyboard shortcuts

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