msystem

package
v0.1.7 Latest Latest
Warning

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

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

Documentation

Index

Constants

This section is empty.

Variables

View Source
var Environment *environment

Functions

func InitSystem

func InitSystem(environment string, dest any)

func LoadConfig

func LoadConfig(path string, dest any) *environment

Types

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 Logger

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

type Mysql

type Mysql struct {
	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 RoutinePool

type RoutinePool struct {
	Queue          chan func(params ...any) error
	Total          int
	RoutineNumber  int
	Running        int
	Result         chan error
	FinishCallback func()
}

func (*RoutinePool) Add

func (domain *RoutinePool) Add(func(params ...any))

func (*RoutinePool) NewPool

func (domain *RoutinePool) NewPool(routineNumber int, total int)

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"`     // 请求超时时间(单位毫秒)
}

Jump to

Keyboard shortcuts

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