config

package
v0.3.0 Latest Latest
Warning

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

Go to latest
Published: Feb 18, 2022 License: Apache-2.0 Imports: 6 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

View Source
var (
	ErrRowsAffectedInvalid = errors.New("db update rows affected invalid")
)
View Source
var (
	ErrSysPanic = errors.New("system panic")
)

Functions

func Init

func Init(configPath string)

Types

type AlibabaCloudAccount added in v0.1.1

type AlibabaCloudAccount struct {
	Region    string `yaml:"Region"`
	AccessKey string `yaml:"AccessKey"`
	Secret    string `yaml:"Secret"`
}

type Config

type Config struct {
	DebugMode           bool                `yaml:"DebugMode"`
	ServerPort          int                 `yaml:"ServerPort"`
	LogFile             string              `yaml:"LogFile"`
	LogLevel            string              `yaml:"LogLevel"`
	WriteDB             DBConfig            `yaml:"WriteDB"`
	ReadDB              DBConfig            `yaml:"ReadDB"`
	BridgXHost          string              `yaml:"BridgXHost"`
	JwtToken            JwtTokenConfig      `yaml:"JwtToken"`
	AlibabaCloudAccount AlibabaCloudAccount `yaml:"AlibabaCloudAccount"`
}
var GlobalConfig *Config

type DBConfig

type DBConfig struct {
	Name         string `yaml:"Name"`
	Host         string `yaml:"Host"`
	Port         string `yaml:"Port"`
	User         string `yaml:"User"`
	Password     string `yaml:"Password"`
	Timeout      string `yaml:"Timeout"`
	ReadTimeout  string `yaml:"ReadTimeout"`
	WriteTimeout string `yaml:"WriteTimeout"`
	MaxIdleConns int    `yaml:"MaxIdleConns"`
	MaxOpenConns int    `yaml:"MaxOpenConns"`
}

type JwtTokenConfig

type JwtTokenConfig struct {
	JwtTokenSignKey        string `yaml:"JwtTokenSignKey"`
	JwtTokenCreatedExpires int64  `yaml:"JwtTokenCreatedExpires"`
	JwtTokenRefreshExpires int64  `yaml:"JwtTokenRefreshExpires"`
	BindContextKeyName     string `yaml:"BindContextKeyName"`
}

Directories

Path Synopsis

Jump to

Keyboard shortcuts

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