cfg

package
v1.1.21 Latest Latest
Warning

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

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

Documentation

Index

Constants

View Source
const (
	DefaultWorkDir = "/usr/local/pprofparser"
	DefaultCfgName = "conf.yml"
	DefaultCfgPath = DefaultWorkDir + "/" + DefaultCfgName
)
View Source
const (
	EnvLocal      = "local"
	EnvDev        = "dev"
	EnvTest       = "test"
	EnvPre        = "pre"
	EnvProduction = "prod"
)

Variables

This section is empty.

Functions

func Load

func Load(file string) error

Types

type Config

type Config struct {
	Serv    Server  `yaml:"server"`
	Log     Log     `yaml:"log"`
	Gin     Gin     `yaml:"gin"`
	Oss     Oss     `yaml:"oss"`
	Storage Storage `yaml:"storage"`
}
var (
	Cfg *Config
)

type Disk

type Disk struct {
	ProfileDir string `yaml:"profile_dir"`
}

type Gin

type Gin struct {
	RunMode  string `yaml:"run_mode"`
	Log      string `yaml:"log"`
	ErrorLog string `yaml:"error_log"`
}

Gin gin configuration

type Log

type Log struct {
	Path  string `yaml:"path"`
	File  string `yaml:"file"`
	Level string `yaml:"level"`
}

Log log configuration

type Oss

type Oss struct {
	Host          string `yaml:"host"`
	AccessKey     string `yaml:"access_key"`
	SecretKey     string `yaml:"secret_key"`
	ProfileBucket string `yaml:"profile_bucket"`
	ProfileDir    string `yaml:"profile_dir"`
}

Oss aliyun oss configuration

type Server

type Server struct {
	Addr string `yaml:"addr"`
	Port string `yaml:"port"`
}

Server configuration

type Storage

type Storage struct {
	Disk Disk `yaml:"disk"`
	Oss  Oss  `yaml:"oss"`
}

Jump to

Keyboard shortcuts

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