conf

package
v0.0.0-...-be974dd Latest Latest
Warning

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

Go to latest
Published: Feb 4, 2023 License: Apache-2.0 Imports: 3 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func Init

func Init(path string)

Types

type Conf

type Conf struct {
	Redis struct {
		Addr     string `yaml:"addr"`
		Password string `yaml:"password"`
		DB       int    `yaml:"db"`
	}
	MYSQL struct {
		Username string `yaml:"username"`
		Password string `yaml:"password"`
		Addr     string `yaml:"addr"`
		Database string `yaml:"database"`
	}
	Jwt struct {
		TokenExpireDuration int    `yaml:"token_expire_duration"` //小时为单位
		Secret              string `yaml:"secret"`
	}
	Server struct {
		Port string `yaml:"port"`
	}
	Oss struct {
		Region          string `yaml:"region"`
		ProviderType    string `yaml:"providerType"`
		Endpoint        string `yaml:"endpoint"`
		AccessKeyId     string `yaml:"access_key_id"`
		AccessKeySecret string `yaml:"access_key_secret"`
		BucketName      string `yaml:"bucket_name"`
	}
	CreateDatabase bool
}

Conf 定义全局配置变量

var Config *Conf

Config 定义全局配置

func LoadConfig

func LoadConfig(ConfigPath string) *Conf

LoadConfig 获取配置

Jump to

Keyboard shortcuts

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