msystem

package
v0.2.8 Latest Latest
Warning

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

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

Documentation

Index

Constants

This section is empty.

Variables

View Source
var Environment = &EnvironmentModel{}

Functions

This section is empty.

Types

type Apollo added in v0.2.4

type Apollo struct {
	AppId          string `toml:"app_id" json:"app_id"`
	Cluster        string `toml:"cluster" json:"cluster"`
	Ip             string `toml:"ip" json:"ip"`
	NamespaceName  string `toml:"namespace_name" json:"namespace_name"`
	IsBackupConfig bool   `toml:"isBackup_config" json:"isBackup_config"`
	Secret         string `toml:"secret" json:"secret"`
}

type ConfigRender added in v0.2.7

type ConfigRender interface {
	SetConfigPath(path string)
	GetEnv() string
	SetEnv(env string)
	Render() string
}

type EnvironmentModel added in v0.2.4

type EnvironmentModel struct {
	Value      string
	ServerName string   `toml:"server_name"`
	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 FileRender added in v0.2.7

type FileRender struct {
	Env  string
	Path string
}

func (*FileRender) GetEnv added in v0.2.7

func (ce *FileRender) GetEnv() string

func (*FileRender) GetFilePath added in v0.2.7

func (ce *FileRender) GetFilePath() string

func (*FileRender) LoadFile added in v0.2.7

func (ce *FileRender) LoadFile() string

func (*FileRender) Render added in v0.2.7

func (ce *FileRender) Render() string

func (*FileRender) SetConfigPath added in v0.2.7

func (ce *FileRender) SetConfigPath(path string)

func (*FileRender) SetEnv added in v0.2.7

func (ce *FileRender) SetEnv(env string)

type Gin

type Gin struct {
	Port          int64  `toml:"port"`    // 端口号
	Mode          string `toml:"release"` // 模式 debug,release,test
	Pprof         bool   `toml:"pprof"`
	PprofSecret   string `toml:"pprof_secret"`
	BasePath      string `toml:"base_path"` // 请求根路径
	Session       string `toml:"session"`
	SessionId     string `toml:"session_id"`
	SessionFile   string `toml:"session_file"`
	SessionSecret string `toml:"session_secret"`
}

type Logger

type Logger struct {
	Level string `toml:"level"`
	Dir   string `toml:"dir"`
}

type Mysql

type Mysql struct {
	TimeZone    string `toml:"time_zone"`     // 时区
	Username    string `toml:"username"`      // 用户名
	Password    string `toml:"password"`      // 密码
	Addr        string `toml:"addr"`          // 地址
	Database    string `toml:"database"`      // 数据库名
	ShowSql     bool   `toml:"show_sql"`      // 打印sql
	MaxIdleConn int    `toml:"max_idle_conn"` // 最大闲置链接数
	MaxOpenConn int    `toml:"max_open_conn"` // 最大活跃连接数
	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:"read_timeout"`
	DialTimeout int    `toml:"dial_timeout"`
}

type Sqlite3

type Sqlite3 struct {
	Addr        string `toml:"addr"`          // 数据源地址
	ShowSql     bool   `toml:"show_sql"`      // 打印sql
	MaxIdleConn int    `toml:"max_idle_conn"` // 最大闲置链接数
	MaxOpenConn int    `toml:"max_open_conn"` // 最大活跃连接数
	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