config

package
v1.0.0 Latest Latest
Warning

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

Go to latest
Published: May 31, 2022 License: Apache-2.0 Imports: 3 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

View Source
var Conf = new(Config)

Conf 全局配置变量

Functions

func InitConfig

func InitConfig() error

InitConfig 初始化配置;从指定文件加载配置文件

Types

type Config

type Config struct {
	Port       int `json:"port"`
	Mongo      `json:"mongo"`
	TencentCOS `json:"cos"`
	LogConfig  `json:"log"`
}

func GetEnv

func GetEnv() *Config

type LogConfig

type LogConfig struct {
	Level      string `json:"level"`
	Filename   string `json:"filename"`
	MaxSize    int    `json:"maxsize"`
	MaxAge     int    `json:"max_age"`
	MaxBackups int    `json:"max_backups"`
}

type Mongo

type Mongo struct {
	Uri string `json:"uri"`
	DB  string `json:"db"`
}

type TencentCOS

type TencentCOS struct {
	Bucket     string `json:"bucket"`
	Region     string `json:"region"`
	SecretID   string `json:"secretID"`
	SecretKey  string `json:"secretKey"`
	BaseURL    string `json:"baseURL"`
	PathPrefix string `json:"pathPrefix"`
}

Jump to

Keyboard shortcuts

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