conf

package
v0.0.0-...-8edd8d8 Latest Latest
Warning

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

Go to latest
Published: Dec 4, 2023 License: MIT Imports: 7 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func LoadConfigFromToml

func LoadConfigFromToml(filepath string) error

Types

type Config

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

func C

func C() *Config

func DefaultConfig

func DefaultConfig() *Config

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) DSN

func (m *MySQL) DSN() string

func (*MySQL) GetConn

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

返回一个数据库链接, 返回一个全局单列

Jump to

Keyboard shortcuts

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