config

package
v0.0.0-...-9634a1a Latest Latest
Warning

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

Go to latest
Published: Feb 15, 2023 License: Apache-2.0 Imports: 18 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func SetDefault

func SetDefault(ptr interface{}) error

Set initializes members in a struct referenced by a pointer. Maps and slices are initialized by `make` and other primitive types are set with default values. `ptr` should be a struct pointer

Types

type Config

type Config struct {
	ControllerConfig ControllerConfig `yaml:"controller"`
}

func DefaultConfig

func DefaultConfig() *Config

func (*Config) Load

func (c *Config) Load(path string)

func (*Config) Validate

func (c *Config) Validate() error

type ControllerConfig

type ControllerConfig struct {
	LogFile                        string `default:"/var/log/controller.log" yaml:"log-file"`
	LogLevel                       string `default:"info" yaml:"log-level"`
	ListenPort                     int    `default:"20417" yaml:"listen-port"`
	ListenNodePort                 int    `default:"30417" yaml:"listen-node-port"` // TODO union port data type
	MasterControllerName           string `default:"" yaml:"master-controller-name"`
	GrpcMaxMessageLength           int    `default:"104857600" yaml:"grpc-max-message-length"`
	GrpcPort                       string `default:"20035" yaml:"grpc-port"`
	IngesterPort                   string `default:"20033" yaml:"ingester-port"`
	GrpcNodePort                   string `default:"30035" yaml:"grpc-node-port"`
	Kubeconfig                     string `yaml:"kubeconfig"`
	ElectionName                   string `default:"deepflow-server" yaml:"election-name"`
	ReportingDisabled              bool   `default:"false" yaml:"reporting-disabled"`
	BillingMethod                  string `default:"license" yaml:"billing-method"`
	PodClusterInternalIPToIngester int    `default:"0" yaml:"pod-cluster-internal-ip-to-ingester"`

	DFWebService DFWebService `yaml:"df-web-service"`

	MySqlCfg      mysql.MySqlConfig           `yaml:"mysql"`
	RedisCfg      redis.RedisConfig           `yaml:"redis"`
	ClickHouseCfg clickhouse.ClickHouseConfig `yaml:"clickhouse"`

	Roze Roze          `yaml:"roze"`
	Spec Specification `yaml:"spec"`

	MonitorCfg     monitor.MonitorConfig         `yaml:"monitor"`
	ManagerCfg     manager.ManagerConfig         `yaml:"manager"`
	GenesisCfg     genesis.GenesisConfig         `yaml:"genesis"`
	StatsdCfg      statsd.StatsdConfig           `yaml:"statsd"`
	TrisolarisCfg  trisolaris.Config             `yaml:"trisolaris"`
	TagRecorderCfg tagrecorder.TagRecorderConfig `yaml:"tagrecorder"`
}

type DFWebService

type DFWebService struct {
	Enabled bool   `default:"false" yaml:"enabled"`
	Host    string `default:"df-web" yaml:"host"`
	Port    int    `default:"20106" yaml:"port"`
	Timeout int    `default:"30" yaml:"timeout"`
}

type Roze

type Roze struct {
	Port    int `default:"20106" yaml:"port"`
	Timeout int `default:"60" yaml:"timeout"`
}

type Setter

type Setter interface {
	SetDefaults()
}

Setter is an interface for setting default values

type Specification

type Specification struct {
	VTapGroupMax               int `default:"1000" yaml:"vtap_group_max"`
	VTapMaxPerGroup            int `default:"10000" yaml:"vtap_max_per_group"`
	AZMaxPerServer             int `default:"10" yaml:"az_max_per_server"`
	DataSourceMax              int `default:"10" yaml:"data_source_max"`
	DataSourceRetentionTimeMax int `default:"1000" yaml:"data_source_retention_time_max"`
}

Jump to

Keyboard shortcuts

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