config

package
v0.0.0-...-97b7911 Latest Latest
Warning

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

Go to latest
Published: Sep 24, 2023 License: MIT Imports: 7 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func Config

func Config() *viper.Viper

func Parse

func Parse(configFile string, obj interface{})

Types

type EsConfig

type EsConfig struct {
	Host     string `mapstructure:"host"`
	Port     int    `mapstructure:"port"`
	Cert     string `mapstructure:"cert"`
	Username string `mapstructure:"username"`
	Password string `mapstructure:"password"`
}

func (EsConfig) Address

func (s EsConfig) Address() string

func (EsConfig) Url

func (s EsConfig) Url() string

type EtcdConfig

type EtcdConfig struct {
	Host string `mapstructure:"host"`
	Port int    `mapstructure:"port"`
}

func (EtcdConfig) Address

func (e EtcdConfig) Address() string

type KafkaConfig

type KafkaConfig struct {
	Host string `mapstructure:"host"`
	Port int    `mapstructure:"port"`
}

func (*KafkaConfig) Scan

func (s *KafkaConfig) Scan(src interface{}) (err error)

func (KafkaConfig) Value

func (s KafkaConfig) Value() (driver.Value, error)

type MongoConfig

type MongoConfig struct {
	Uri      string `mapstructure:"uri"`
	Database string `mapstructure:"database"`
	Username string `mapstructure:"username"`
	Password string `mapstructure:"password"`
	Option   *MongoOption
}

func (*MongoConfig) Scan

func (s *MongoConfig) Scan(src interface{}) (err error)

func (MongoConfig) Value

func (s MongoConfig) Value() (driver.Value, error)

type MongoOption

type MongoOption struct {
	MaxPoolSize int
	MinPoolSize int
}

type PGConfig

type PGConfig struct {
	Host     string `mapstructure:"host"`
	Port     int    `mapstructure:"port"`
	Database string `mapstructure:"database"`
	Username string `mapstructure:"username"`
	TimeZone string `mapstructure:"timezone"`
	Password string `mapstructure:"password"`
}

func (PGConfig) Dns

func (p PGConfig) Dns() string

type RabbitMqConfig

type RabbitMqConfig struct {
	Host     string `mapstructure:"host"`
	Port     int    `mapstructure:"port"`
	Username string `mapstructure:"username"`
	Password string `mapstructure:"password"`
}

func (RabbitMqConfig) Dns

func (r RabbitMqConfig) Dns() string

type RedisConfig

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

type ServerConfig

type ServerConfig struct {
	Host string `mapstructure:"host"`
	Port int    `mapstructure:"port"`
}

func (ServerConfig) Address

func (s ServerConfig) Address() string

Jump to

Keyboard shortcuts

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