setting

package
v1.6.4 Latest Latest
Warning

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

Go to latest
Published: Jul 5, 2024 License: MIT Imports: 5 Imported by: 0

Documentation

Index

Constants

View Source
const DefaultSection = "default"

Variables

This section is empty.

Functions

func Write

func Write(rawConfig []string, filename string) error

Types

type Setting

type Setting struct {
	Db struct {
		Engine   string `ini:"db.engine"`
		Host     string `ini:"db.host"`
		Port     int    `ini:"db.port"`
		User     string `ini:"db.user"`
		Password string `ini:"db.password"`
		Database string `ini:"db.database"`
		Prefix   string `ini:"db.prefix"`
		Charset  string `ini:"db.charset"`

		MaxIdleConns int `ini:"db.max.idle.conns"`
		MaxOpenConns int `ini:"db.max.open.conns"`

		Sslmode       string `ini:"db.sslmode"`
		SslCaFile     string `ini:"db.ssl_ca_file"`
		SslCertFile   string `ini:"db.ssl_cert_file"`
		SslKeyFile    string `ini:"db.ssl_key_file"`
		SslServerName string `ini:"db.ssl_server_name"`
	}
	AllowIps             string `ini:"allow_ips"`
	AllowLocalhostBypass bool   `ini:"allow_localhost_bypass"`
	AppName              string `ini:"app.name"`
	ApiKey               string `ini:"api.key"`
	ApiSecret            string `ini:"api.secret"`
	ApiSignEnable        bool   `ini:"api.sign.enable"`

	EnableTLS bool   `ini:"enable_tls"`
	CAFile    string `ini:"ca_file"`
	CertFile  string `ini:"cert_file"`
	KeyFile   string `ini:"key_file"`

	ConcurrencyQueue int    `ini:"concurrency.queue"`
	AuthSecret       string `ini:"auth_secret"`
}

func Read

func Read(filename string) (*Setting, error)

读取配置

Jump to

Keyboard shortcuts

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