config

package
v0.0.0-...-495f4b4 Latest Latest
Warning

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

Go to latest
Published: Jun 17, 2020 License: Apache-2.0 Imports: 2 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func Get

func Get(key string) interface{}

func GetBool

func GetBool(key string) bool

func GetInt

func GetInt(key string) int

func GetString

func GetString(key string) string

func GetStringMap

func GetStringMap(key string) map[string]interface{}

func GetStringMapString

func GetStringMapString(key string) map[string]string

func GetStringSlice

func GetStringSlice(key string) []string

func IsSet

func IsSet(key string) bool

func ReadConfig

func ReadConfig()

func Set

func Set(key string, value interface{})

func SetConfigPath

func SetConfigPath(path string)

Types

type CommonConfig

type CommonConfig struct {
	StaticPath string `mapstructure:"staticPath"`
}

type Config

type Config struct {
	Serve    ServeConfig    `mapstructure:"serve"`
	DbServer DBConfig       `mapstructure:"dbServer"`
	Common   CommonConfig   `mapstructure:"common"`
	Rabbitmq RabbitmqConfig `mapstructure:"rabbitmq"`
	Oss      OssConfig      `mapstructure:"oss"`
}

func GetConfig

func GetConfig() Config

type DBConfig

type DBConfig struct {
	HostPort string `mapstructure:"hostPort"`
}

type OssConfig

type OssConfig struct {
	EndPoint        string `mapstructure:"endPoint"`
	AccessKeyID     string `mapstructure:"accessKeyID"`
	AccessKeySecret string `mapstructure:"accessKeySecret"`
	BucketName      string `mapstructure:"bucketName"`
}

type RabbitmqConfig

type RabbitmqConfig struct {
	HostPort    string              `mapstructure:"hostPort"`
	Username    string              `mapstructure:"username"`
	Password    string              `mapstructure:"password"`
	Prefetch    int                 `mapstructure:"prefetch"`
	VHost       string              `mapstructure:"vHost"`
	Exchanges   []map[string]string `mapstructure:"exchanges"`
	QueuePrefix string              `mapstructure:"queuePrefix"`
}

type ServeConfig

type ServeConfig struct {
	HostPort string `mapstructure:"hostPort"`
}

Jump to

Keyboard shortcuts

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