config

package
v0.0.0-...-63ace11 Latest Latest
Warning

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

Go to latest
Published: Jun 3, 2022 License: MIT Imports: 7 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func InitMetaSvrConf

func InitMetaSvrConf()

Types

type DbNode

type DbNode struct {
	Addr     string `json:"addr"`
	Username string `json:"username"`
	Password string `json:"password"`
	DbName   string `json:"dbname"`
	DbType   string `json:"dbtype"`
}

type DbYaml

type DbYaml struct {
	Decrypt bool   `json:"decrypt,omitempty"`
	DbType  string `json:"db_type,omitempty"`

	DbSources []DbNode `json:"db_sources,omitempty"`

	ConnMaxLifetime int `json:"conn_max_lifetime,omitempty"`
	ConnMaxIdletime int `json:"conn_max_idletime,omitempty"`
	ConnTimeout     int `json:"conn_timeout,omitempty"`
	ReadTimeout     int `json:"read_timeout,omitempty"`
	MaxIdleConns    int `json:"max_idle_conns,omitempty"`
	MaxOpenConns    int `json:"max_open_conns,omitempty"`
}

func (*DbYaml) Load

func (dbYaml *DbYaml) Load(file string)

parse db yaml format config to struct: DbYaml

type MetaSvrConfig

type MetaSvrConfig struct {
	GoMaxPorc    int  `json:"go_max_porc,omitempty"`
	PProfEnabled bool `json:"pprof_enable,omitempty"`
	PProfPort    int  `json:"pprof_port,omitempty"`

	MetaServId    string `json:"meta_serv_id,omitempty"`
	WebApiAddress string `json:"web_api_address,omitempty"`
	WebApiUseSSL  bool   `json:"web_api_use_ssl,omitempty"`

	ServerlessGatewayRegist     bool   `json:"serverless_gateway_regist,omitempty"`
	ServerlessGatewayAddress    string `json:"serverless_gateway_address,omitempty"`
	ServerlessGatewayUpstreamId string `json:"serverless_gateway_upstream_id,omitempty"`
	ServerlessGatewayServiceId  string `json:"serverless_gateway_service_id,omitempty"`
	ServerlessGatewayXapiKey    string `json:"serverless_gateway_xapi_key,omitempty"`

	AlarmNotifyUrl     string `json:"alarm_notify_url,omitempty"`
	AlarmNotifyEnabled bool   `json:"alarm_notify_enabled,omitempty"`

	ThreadPoolCoreSize int `json:"thread_pool_core_size,omitempty"`
	ThreadPoolMaxSize  int `json:"thread_pool_max_size,omitempty"`

	EventbusEnabled              bool   `json:"eventbus_enabled,omitempty"`
	EventbusAddress              string `json:"eventbus_address,omitempty"`
	EventbusConsumerSubscription string `json:"eventbus_consumer_subscription,omitempty"`
	EventbusExpireTtl            int64  `json:"eventbus_expire_ttl,omitempty"`

	AlarmTimeWindow int `json:"alarm_time_window,omitempty"`

	PasswordExpire      int  `json:"password_expire,omitempty"`
	NeedAuth            bool `json:"need_auth,omitempty"`
	CheckBlackwhiteList bool `json:"check_blackwhite_list,omitempty"`

	RaftClusterEnabled bool `json:"raft_cluster_enabled,omitempty"`
	CollectEnabled     bool `json:"collect_enabled,omitempty"`
	CollectInterval    int  `json:"collect_interval,omitempty"`

	RedisCluster            string        `json:"redis_cluster,omitempty"`
	RedisAuth               string        `json:"redis_auth,omitempty"`
	RedisPoolMaxSize        int           `json:"redis_pool_max_size,omitempty"`
	RedisPoolMinSize        int           `json:"redis_pool_min_size,omitempty"`
	RedisIdleTimeout        time.Duration `json:"redis_idle_timeout,omitempty"`
	RedisIdleCheckFrequency time.Duration `json:"redis_idle_check_frequency,omitempty"`
	RedisDialTimeout        time.Duration `json:"redis_dial_timeout,omitempty"`
	RedisReadTimeout        time.Duration `json:"redis_read_timeout,omitempty"`
	RedisWriteTimeout       time.Duration `json:"redis_write_timeout,omitempty"`

	MetadbYamlName string `json:"metadb_yaml_name,omitempty"`
	TDYamlName     string `json:"td_yaml_name,omitempty"`
}
var (
	META_SVR_CONFIG *MetaSvrConfig = nil
)

func NewConfig

func NewConfig() *MetaSvrConfig

type RedisConfig

type RedisConfig struct {
	Addr        string        `json:"addr,omitempty"`
	Password    string        `json:"password,omitempty"`
	MaxActive   int           `json:"max_active,omitempty"`
	MaxIdle     int           `json:"max_idle,omitempty"`
	IdleTimeout time.Duration `json:"idle_timeout,omitempty"`
}

Jump to

Keyboard shortcuts

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