config

package
v0.0.0-...-e809d31 Latest Latest
Warning

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

Go to latest
Published: May 17, 2023 License: GPL-3.0 Imports: 4 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

View Source
var (
	GlobalServerConfig ServerConfig
	GlobalNacosConfig  NacosConfig
)

Functions

This section is empty.

Types

type EmailConfig

type EmailConfig struct {
	Host     string `mapstructure:"host"`
	Email    string `mapstructure:"email"`
	Password string `mapstructure:"password"`
	Port     int    `mapstructure:"port"`
}

type JWTConfig

type JWTConfig struct {
	SigningKey string `mapstructure:"key" json:"key"`
}

type MongoConfig

type MongoConfig struct {
	Host     string `mapstructure:"host" json:"host"`
	Port     int    `mapstructure:"port" json:"port"`
	User     string `mapstructure:"user" json:"user"`
	Password string `mapstructure:"password" json:"password"`
	Name     string `mapstructure:"db" json:"db"`
}

type MysqlConfig

type MysqlConfig struct {
	Host     string `mapstructure:"host" json:"host"`
	Port     int    `mapstructure:"port" json:"port"`
	Name     string `mapstructure:"db" json:"db"`
	User     string `mapstructure:"user" json:"user"`
	Password string `mapstructure:"password" json:"password"`
}

type NacosConfig

type NacosConfig struct {
	Host      string `mapstructure:"host"`
	Port      uint64 `mapstructure:"port"`
	Namespace string `mapstructure:"namespace"`
	User      string `mapstructure:"user"`
	Password  string `mapstructure:"password"`
	DataId    string `mapstructure:"dataid"`
	Group     string `mapstructure:"group"`
}

type NsqConfig

type NsqConfig struct {
	Host  string `mapstructure:"host" json:"host"`
	Port  int    `mapstructure:"port" json:"port"`
	Topic string `mapstructure:"topic" json:"topic"`
}

type OtelConfig

type OtelConfig struct {
	EndPoint string `mapstructure:"endpoint" json:"endpoint"`
}

type RPCSrvConfig

type RPCSrvConfig struct {
	Name string `mapstructure:"name" json:"name"`
}

type RedisConfig

type RedisConfig struct {
	Host     string `mapstructure:"host" json:"host"`
	Port     int    `mapstructure:"port" json:"port"`
	Password string `mapstructure:"password" json:"password"`
}

type ServerConfig

type ServerConfig struct {
	Name      string      `mapstructure:"name" json:"name"`
	Host      string      `mapstructure:"host" json:"host"`
	JWTInfo   JWTConfig   `mapstructure:"jwt" json:"jwt"`
	OtelInfo  OtelConfig  `mapstructure:"otel" json:"otel"`
	MysqlInfo MysqlConfig `mapstructure:"mysql" json:"mysql"`
	MongoInfo MongoConfig `mapstructure:"mongo" json:"mongo"`
	NsqInfo   NsqConfig   `mapstructure:"nsq" json:"nsq"`
	RedisInfo RedisConfig `mapstructure:"redis" json:"redis"`
	EmailInfo EmailConfig `mapstructure:"email" json:"email"`
}

func (ServerConfig) GetMongoAuth

func (c ServerConfig) GetMongoAuth() options.Credential

func (ServerConfig) GetMongoOptions

func (c ServerConfig) GetMongoOptions() (*options.ClientOptions, string)

func (ServerConfig) GetMysqlDsn

func (c ServerConfig) GetMysqlDsn() string

func (ServerConfig) GetRedisOption

func (c ServerConfig) GetRedisOption() *redis.Options

Jump to

Keyboard shortcuts

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