config

package
v0.0.0-...-a9c7570 Latest Latest
Warning

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

Go to latest
Published: May 9, 2024 License: MIT Imports: 9 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func BytesToTLSConfig

func BytesToTLSConfig(certPEM, keyPEM, caPEM []byte) (c *tls.Config, err error)

func Camel2Case

func Camel2Case(name string) string

驼峰式写法转为下划线写法

func LoadTLSConfig

func LoadTLSConfig(efs embed.FS, certFile, keyFile, caFile string) (c *tls.Config, err error)

func Unmarshal

func Unmarshal(bs []byte, conf interface{}) (err error)

Types

type Conn

type Conn struct {
	TCP              string
	Addr             string
	Host             string
	EnableTLS        bool
	ReadConcurrency  int
	WriteConcurrency int
	ReadWindow       int
	WriteWindow      int
	FlushTime        int
	Heartbeat        int
	TLS              struct {
		CACert     string
		ServerCert string
		ServerKey  string
		ClientCert string
		ClientKey  string
	}
}

type DB

type DB struct {
	Host             string
	Port             string
	User             string
	Password         string
	DBName           string
	SSLMode          bool
	WriteConcurrency int
	Span             int
}

type GRPC

type GRPC struct {
	CACert     string
	ServerKey  string
	ServerCert string
	ClientKey  string
	ClientCert string
	Protocol   string
	Addr       string
	Host       string
	HostAddrs  []string
}

type Log

type Log struct {
	StoreLevel string // 写到存储的 level
	LogLevel   string
	ToConsole  bool

	// 日志大小到达MaxSize(MB)就开始backup,默认值是100.
	MaxSize int
	// 旧日志保存的最大天数,默认保存所有旧日志文件
	MaxAge int
	// 旧日志保存的最大数量,默认保存所有旧日志文件
	MaxBackups int
	// 对backup的日志是否进行压缩,默认不压缩
	Compress bool
	// 是否使用本地时间,否则使用UTC时间
	LocalTime bool
	// 日志文件名,归档日志也会保存在对应目录下
	// 若该值为空,则日志会保存到os.TempDir()目录下,日志文件名为
	// <processname>-lumberjack.log
	Filename string
}

type Queue

type Queue struct {
	DBFile     string
	Limit      string
	CAPassword string
	CAIv       string
}

Jump to

Keyboard shortcuts

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