config

package
v0.0.11 Latest Latest
Warning

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

Go to latest
Published: Feb 5, 2024 License: LGPL-2.1 Imports: 7 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func InitConsulCacheConfig

func InitConsulCacheConfig()

func InitFetcherConfig

func InitFetcherConfig()

func ReadConfig

func ReadConfig(role string, cfgFile string)

Types

type ConsulCacheConfig

type ConsulCacheConfig struct {
	Logger LogConfig `mapstructure:"logger"`

	RedisConsul RedisConf `mapstructure:"redis-consul"`

	StateMQ RocketMQ `mapstructure:"rocketmq-state"`

	Cache struct {
		Expiration time.Duration `mapstructure:"expiration"`
	} `mapstructure:"cache"`

	Web struct {
		Mode              string `mapstructure:"mode"`
		MiddlewareEnabled bool   `mapstructure:"middleware_enabled"`
		ListenAddress     string `mapstructure:"listen_address"`
		PprofAddress      string `mapstructure:"pprof_address"`
		PrometheusAddress string `mapstructure:"prometheus_address"`
	} `mapstructure:"web"`
}

func GetConsulCacheOpts

func GetConsulCacheOpts() *ConsulCacheConfig

type FetcherConfig

type FetcherConfig struct {
	Logger      LogConfig          `mapstructure:"logger"`
	Consuls     []model.ConsulInfo `mapstructure:"consuls"`
	Services    []string           `mapstructure:"services"`
	RedisConsul RedisConf          `mapstructure:"redis-consul"`

	StateMQ RocketMQ `mapstructure:"rocketmq-state"`
}

func GetFetcherOpts

func GetFetcherOpts() *FetcherConfig

type LogConfig

type LogConfig struct {
	Level    string `mapstructure:"level"`
	FilePath string `mapstructure:"filepath"`
}

type RedisConf

type RedisConf struct {
	Addr            string        `mapstructure:"addr"`
	Password        string        `mapstructure:"password"`
	DB              int           `mapstructure:"db"`
	MaxRetries      int           `mapstructure:"maxRetries"`
	MinRetryBackoff time.Duration `mapstructure:"minRetryBackoff"`
	MaxRetryBackoff time.Duration `mapstructure:"maxRetryBackoff"`
	DialTimeout     time.Duration `mapstructure:"dialTimeout"`
	ReadTimeout     time.Duration `mapstructure:"readTimeout"`
	WriteTimeout    time.Duration `mapstructure:"writeTimeout"`
	PoolSize        int           `mapstructure:"poolSize"`
	PoolTimeout     time.Duration `mapstructure:"poolTimeout"`
}

type RocketMQ

type RocketMQ struct {
	NameServers string              `mapstructure:"NameServers"`
	Topic       string              `mapstructure:"topic"`
	Producer    RocketMQParticipant `mapstructure:"producer"`
	Consumer    RocketMQParticipant `mapstructure:"consumer"`
}

type RocketMQParticipant

type RocketMQParticipant struct {
	GroupID string `mapstructure:"groupId"`
}

Jump to

Keyboard shortcuts

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