config

package
v0.0.0-...-7206171 Latest Latest
Warning

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

Go to latest
Published: Mar 13, 2023 License: MulanPSL-2.0 Imports: 4 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

View Source
var (
	SysConfig     ServerConfig
	SysConfigDir  string
	SysConfigName string
)

Functions

func InitConfig

func InitConfig() error

Types

type MongoDbConfig

type MongoDbConfig struct {
	MongoName        string
	MongoHosts       string
	MongoAuthDb      string
	MongoAuthUser    string
	MongoAuthPass    string
	MongoMaxPoolSize int
}

type MysqlConfig

type MysqlConfig struct {
	MysqlMaxIdle   int
	MysqlMaxActive int
	MysqlDb        []MysqlDbConfig
}

type MysqlDbConfig

type MysqlDbConfig struct {
	MysqlName string
	MysqlUrl  string
	MysqlUser string
	MysqlPwd  string
	MysqlDb   string
}

type OssConfig

type OssConfig struct {
	Endpoint        string
	AccessKeyId     string
	AccessKeySecret string
	Bucket          string
	Url             string
}

type RedisConfig

type RedisConfig struct {
	RedisMaxIdle   int
	RedisMaxActive int
	RedisTimeout   int
	RedisDb        []RedisDbConfig
}

type RedisDbConfig

type RedisDbConfig struct {
	RedisName string
	RedisUrl  string
	RedisPwd  string
	RedisDb   int
}

type RocketmqConfig

type RocketmqConfig struct {
	MqEndpoint       string
	MqAccessKey      string
	MqSecretKey      string
	MqGroup          string
	MqInstanceId     string
	MqProducerTopics string
	MqConsumerTopics string
	MqSubscribe      string
}

type ServerConfig

type ServerConfig struct {
	MysqlCfg    *MysqlConfig    //
	MongoCfg    *MongoDbConfig  //
	RedisCfg    *RedisConfig    //
	RocketmqCfg *RocketmqConfig //
	OssCfg      *OssConfig      //
	HttpPort    string          // 监听端口
	ServiceName string          // 服务名称
	Debug       bool            // 是否调试模式
}

func NewConfig

func NewConfig(configs ...*viper.Viper) ServerConfig

NewConfig creates a new config with a given viper config if given

Jump to

Keyboard shortcuts

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