msystem

package
v0.2.6 Latest Latest
Warning

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

Go to latest
Published: Jun 28, 2023 License: GPL-3.0 Imports: 3 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

View Source
var Environment = &EnvironmentModel{}

Functions

func InitSystem

func InitSystem(environment string, dest ...any)

func LoadConfig

func LoadConfig(path string, dest ...any)

Types

type Apollo added in v0.2.4

type Apollo struct {
	AppId          string `toml:"appId" json:"appId"`
	Cluster        string `toml:"cluster" json:"cluster"`
	Ip             string `toml:"ip" json:"ip"`
	NamespaceName  string `toml:"namespaceName" json:"namespaceName"`
	IsBackupConfig bool   `toml:"isBackupConfig" json:"isBackupConfig"`
	Secret         string `toml:"secret" json:"secret"`
}

type EnvironmentModel added in v0.2.4

type EnvironmentModel struct {
	Value      string
	ServerName string   `toml:"serverName"`
	Banner     string   `toml:"banner"`
	Apollo     *Apollo  `toml:"apollo"`
	Mysql      *Mysql   `toml:"mysql"`
	Sqlite     *Sqlite3 `toml:"sqlite3"`
	Gin        *Gin     `toml:"gin"`
	Logger     *Logger  `toml:"logger"`
	Redis      *Redis   `toml:"redis"`
}

type Gin

type Gin struct {
	Port          int64  `toml:"port"` // 端口号
	Pprof         bool   `toml:"pprof"`
	PprofSecret   string `toml:"pprofSecret"`
	BasePath      string `toml:"basePath"` // 请求根路径
	Session       string `toml:"session"`
	SessionId     string `toml:"sessionId"`
	SessionFile   string `toml:"sessionFile"`
	SessionSecret string `toml:"sessionSecret"`
}

type Loader added in v0.2.4

type Loader interface {
	GetEnv() string
	SetEnv(env string)
	Loader(dest ...any)
}

type Logger

type Logger struct {
	Level string `json:"level"`
}

type Mysql

type Mysql struct {
	TimeZone    string `toml:"timeZone"`    // 时区
	Username    string `toml:"username"`    // 用户名
	Password    string `toml:"password"`    // 密码
	Addr        string `toml:"addr"`        // 地址
	Database    string `toml:"database"`    // 数据库名
	ShowSql     bool   `toml:"showSql"`     // 打印sql
	MaxIdleConn int    `toml:"maxIdleConn"` // 最大闲置链接数
	MaxOpenConn int    `toml:"maxOpenConn"` // 最大活跃连接数
	Timeout     int64  `toml:"timeout"`     // 请求超时时间(单位毫秒)
}

func (Mysql) ToUrl

func (domain Mysql) ToUrl() string

type Redis

type Redis struct {
	Network     string `toml:"network"`
	Addr        string `toml:"addr"`
	Password    string `toml:"password"`
	DB          int    `toml:"db"`
	ReadTimeout int    `toml:"readTimeout"`
	DialTimeout int    `toml:"dialTimeout"`
}

type Sqlite3

type Sqlite3 struct {
	Addr        string `toml:"addr"`        // 数据源地址
	ShowSql     bool   `toml:"showSql"`     // 打印sql
	MaxIdleConn int    `toml:"maxIdleConn"` // 最大闲置链接数
	MaxOpenConn int    `toml:"maxOpenConn"` // 最大活跃连接数
	Timeout     int64  `toml:"timeout"`     // 请求超时时间(单位毫秒)
}

Directories

Path Synopsis

Jump to

Keyboard shortcuts

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