conf

package
v0.0.0-...-d224df5 Latest Latest
Warning

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

Go to latest
Published: Jan 13, 2022 License: MIT Imports: 8 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

View Source
var ConfigPath string

Functions

This section is empty.

Types

type Cfg

type Cfg struct {
	Raw         *ini.File
	User        string
	BindAddress string
	Port        int
	BaseDir     string
	DataDir     string
	AppName     string

	ProfilePort int
	// session
	SessionTimeout         string `default:"60s" yaml:"session_timeout" json:"session_timeout,omitempty"`
	SessionTimeoutDuration time.Duration
	SessionNumber          int `default:"1000" yaml:"session_number" json:"session_number,omitempty"`

	// app
	FailFastTimeout         string `default:"5s" yaml:"fail_fast_timeout" json:"fail_fast_timeout,omitempty"`
	FailFastTimeoutDuration time.Duration

	// session tcp parameters
	MySQLSessionParam MySQLSessionParam `required:"true" yaml:"getty_session_param" json:"getty_session_param,omitempty"`
}

* user = mysql pid-file = /var/run/mysqld/mysqld.pid socket = /var/run/mysqld/mysqld.sock port = 3307 basedir = /usr datadir = /var/lib/mysql tmpdir = /tmp lc-messages-dir = /usr/share/mysql

func NewCfg

func NewCfg() *Cfg

func (*Cfg) Load

func (cfg *Cfg) Load(args *CommandLineArgs) *Cfg

type CommandLineArgs

type CommandLineArgs struct {
	ConfigPath string
}

type MySQLSessionParam

type MySQLSessionParam struct {
	CompressEncoding        bool   `default:"false" yaml:"compress_encoding" json:"compress_encoding,omitempty"`
	TcpNoDelay              bool   `default:"true" yaml:"tcp_no_delay" json:"tcp_no_delay,omitempty"`
	TcpKeepAlive            bool   `default:"true" yaml:"tcp_keep_alive" json:"tcp_keep_alive,omitempty"`
	KeepAlivePeriod         string `default:"180s" yaml:"keep_alive_period" json:"keep_alive_period,omitempty"`
	KeepAlivePeriodDuration time.Duration
	TcpRBufSize             int `default:"262144" yaml:"tcp_r_buf_size" json:"tcp_r_buf_size,omitempty"`
	TcpWBufSize             int `default:"65536" yaml:"tcp_w_buf_size" json:"tcp_w_buf_size,omitempty"`
	PkgRQSize               int
	PkgWQSize               int    `default:"1024" yaml:"pkg_wq_size" json:"pkg_wq_size,omitempty"`
	TcpReadTimeout          string `default:"1s" yaml:"tcp_read_timeout" json:"tcp_read_timeout,omitempty"`
	TcpReadTimeoutDuration  time.Duration
	TcpWriteTimeout         string `default:"5s" yaml:"tcp_write_timeout" json:"tcp_write_timeout,omitempty"`
	TcpWriteTimeoutDuration time.Duration
	WaitTimeout             string `default:"7s" yaml:"wait_timeout" json:"wait_timeout,omitempty"`
	WaitTimeoutDuration     time.Duration
	MaxMsgLen               int    `default:"1024" yaml:"max_msg_len" json:"max_msg_len,omitempty"`
	SessionName             string `default:"echo-server" yaml:"session_name" json:"session_name,omitempty"`
}

Jump to

Keyboard shortcuts

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