config

package
v0.0.0-...-701726f Latest Latest
Warning

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

Go to latest
Published: Nov 19, 2024 License: EPL-1.0 Imports: 20 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func Eureka

func Eureka() *eureka.Client

func GetAtomicLevel

func GetAtomicLevel() zap.AtomicLevel

func InitConf

func InitConf(configPath string, debugMode bool)

InitConf 加载服务端配置

func LoadConfig

func LoadConfig(configPath string, configStruct interface{}, valid bool) error

func Logger

func Logger() *zap.SugaredLogger

func NewEureka

func NewEureka()

func NewLogger

func NewLogger()

func NewMySql

func NewMySql()

func NewRabbit

func NewRabbit()

func NewRedis

func NewRedis()

func Rabbit

func Rabbit() *rabbit.MqClient

func Redis

func Redis() *redis.Client

Types

type AppConfig

type AppConfig struct {
	RunMode  bool
	AppName  string `yaml:"application"`
	Server   ServerConfig
	Database DatabaseConfig
	Redis    RedisConfig
	Rabbit   RabbitConfig
	Log      Log
}

AppConfig 服务端配置数据结构

func GetAppConfig

func GetAppConfig() *AppConfig

type DatabaseConfig

type DatabaseConfig struct {
	Type     string
	User     string
	Password string
	Host     string
	DbName   string
	Charset  string
}

type Log

type Log struct {
	Path string
}

type RabbitConfig

type RabbitConfig struct {
	Host     string
	User     string
	Password string
}

type RedisConfig

type RedisConfig struct {
	Host     string
	Password string
	Db       int
	PoolSize int
}

type ServerConfig

type ServerConfig struct {
	Port         int
	ReadTimeout  time.Duration
	WriteTimeout time.Duration
}

func GetServerConfig

func GetServerConfig() *ServerConfig

Jump to

Keyboard shortcuts

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