options

package
v1.0.0 Latest Latest
Warning

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

Go to latest
Published: May 5, 2022 License: MIT Imports: 14 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func MysqlConn

func MysqlConn(dsn string, moc, mic int) (*gorm.DB, error)

Types

type GlobalOPT

type GlobalOPT struct {
	// 以下配置项是由应用程序设置
	MapCache *cache.Cache
	Redis    *redis.Client
	DB       *gorm.DB
	DBRO     *gorm.DB
	// sqlite3
	SLDB   *gorm.DB
	ExtDB  map[string]*gorm.DB
	ErrLog *mlog.Logger
	// 以下配置项由配置文件设置
	Prefix                string
	PrefixLen             int `internal:"yes"`
	BaseURL               string
	SessionExpire         int64
	ExtOPT                map[string]string
	SessionSecretKey      string
	SessionSecretKeyBytes []byte
	PWDSecretKey          string
	MaxBodySize           int64
	Bind                  string
	Port                  string
	PidFile               string
	LogDir                string
	LogLevel              string
}

GlobalOPT 全局配置

var (
	GolbalConf *GlobalOPT
)

func GOPT

func GOPT() GlobalOPT

GOPT 全局配置参数

func GOPTP

func GOPTP() *GlobalOPT

func ReadConfig

func ReadConfig(cfile string) (GlobalOPT, error)

ReadConfig 从配置文件读取配置

func ReadConfigP

func ReadConfigP(cfile string) (*GlobalOPT, error)

Jump to

Keyboard shortcuts

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