config

package
v1.0.1 Latest Latest
Warning

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

Go to latest
Published: Aug 21, 2022 License: MIT Imports: 11 Imported by: 0

Documentation

Overview

Code generated for package config by go-bindata DO NOT EDIT. (@generated) sources: config.dev.yaml config.prod.yaml config.test.yaml

Index

Constants

This section is empty.

Variables

View Source
var AllowIpList = []string{
	"*",
}
View Source
var ConfEnv string

ConfEnv env环境变量

Functions

func Asset

func Asset(name string) ([]byte, error)

Asset loads and returns the asset for the given name. It returns an error if the asset could not be found or could not be loaded.

func AssetDir

func AssetDir(name string) ([]string, error)

AssetDir returns the file names below a certain directory embedded in the file by go-bindata. For example if you run go-bindata on data/... and data contains the following hierarchy:

data/
  foo.txt
  img/
    a.png
    b.png

then AssetDir("data") would return []string{"foo.txt", "img"} AssetDir("data/img") would return []string{"a.png", "b.png"} AssetDir("foo.txt") and AssetDir("notexist") would return an error AssetDir("") will return []string{"data"}.

func AssetInfo

func AssetInfo(name string) (os.FileInfo, error)

AssetInfo loads and returns the asset info for the given name. It returns an error if the asset could not be found or could not be loaded.

func AssetNames

func AssetNames() []string

AssetNames returns the names of the assets.

func MustAsset

func MustAsset(name string) []byte

MustAsset is like Asset but panics when Asset would return an error. It simplifies safe initialization of global variables.

func RestoreAsset

func RestoreAsset(dir, name string) error

RestoreAsset restores an asset under the given directory

func RestoreAssets

func RestoreAssets(dir, name string) error

RestoreAssets restores an asset under the given directory recursively

Types

type Amqp

type Amqp struct {
	Host     string `yaml:"host" default:"127.0.0.1"`
	Port     string `yaml:"port" default:"5672"`
	User     string `yaml:"user" default:"guest"`
	Password string `yaml:"password" default:""`
	Vhost    string `yaml:"vhost" default:""`
}

type Conf

type Conf struct {
	Server Server `yaml:"server"`
	Jwt    Jwt    `yaml:"jwt"`
	Log    Log    `yaml:"log"`
	Mysql  Mysql  `yaml:"mysql"`
	Redis  Redis  `yaml:"redis"`
	Amqp   Amqp   `yaml:"amqp"`
	Oss    Oss    `yaml:"oss"`
}

func InitConfig

func InitConfig() *Conf

InitConfig 初始化config配置

func OriginConfig added in v1.0.1

func OriginConfig() *Conf

OriginConfig 直接读取yaml配置文件

type Jwt

type Jwt struct {
	TokenExpire int64  `yaml:"tokenExpire" default:"864000"`
	TokenKey    string `yaml:"tokenKey" default:"Authorization"`
	TokenIssuer string `yaml:"tokenIssuer" default:"gin-framework"`
	Secret      string `yaml:"secret"`
}

type Log

type Log struct {
	Debug    bool   `yaml:"debug" default:"true"`
	FileName string `yaml:"fileName" default:"gin-framework"`
	DirPath  string `yaml:"dirPath" default:"runtime/logs"`
}

type Mysql

type Mysql []struct {
	Host         string `yaml:"host" default:"127.0.0.1"`
	Port         string `yaml:"port" default:"3306"`
	User         string `yaml:"user" default:"root"`
	Password     string `yaml:"password" default:"123456"`
	DbName       string `yaml:"dbname"`
	Prefix       string `yaml:"prefix" default:""`
	MaxIdleConns int    `yaml:"maxIdleConns" default:"10"`
	MaxOpenConns int    `yaml:"maxOpenConns" default:"100"`
	MaxLifeTime  int    `yaml:"maxLifeTime" default:"60"`
}

type Oss

type Oss struct {
	EndPoint        string `yaml:"endPoint" default:"https://oss-cn-shanghai.aliyuncs.com"`
	AccessKeyId     string `yaml:"accessKeyId"`
	AccessKeySecret string `yaml:"accessKeySecret"`
	BucketName      string `yaml:"bucketName"`
}

type Redis

type Redis struct {
	Host        string `yaml:"host" default:"127.0.0.1"`
	Port        string `yaml:"port" default:"6379"`
	Password    string `yaml:"password"`
	DbNum       int    `yaml:"dbNum" default:"0"`
	LoginPrefix string `yaml:"loginPrefix" default:"mqenergy_login_auth_"`
}

type Server

type Server struct {
	Mode            string `yaml:"mode" default:"debug"`
	DefaultPageSize int    `yaml:"defaultPageSize" default:"10"`
	MaxPageSize     int    `yaml:"maxPageSize" default:"500"`
	FileUploadPath  string `yaml:"fileUploadPath"`
}

Jump to

Keyboard shortcuts

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