config

package
v0.0.0-...-8d187f3 Latest Latest
Warning

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

Go to latest
Published: Oct 22, 2024 License: Apache-2.0 Imports: 22 Imported by: 1

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"`
	SSLGrpcPort                    string `default:"20135" yaml:"ssl-grpc-port"`
	AgentSSLCertFile               string `default:"/etc/ssl/server.key" yaml:"agent_ssl_cert_file"`
	AgentSSLKeyFile                string `default:"/etc/ssl/server.pem" yaml:"agent_ssl_key_file"`
	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"`
	NoTeamIDRefused                bool   `default:"false" yaml:"no-teamid-refused"`
	AllAgentConnectToNatIP         bool   `default:"false" yaml:"all-agent-connect-to-nat-ip"`
	NoIPOverlapping                bool   `default:"false" yaml:"no-ip-overlapping"`
	AgentCommandTimeout            int    `default:"30" yaml:"agent-cmd-timeout"`

	DFWebService DFWebService   `yaml:"df-web-service"`
	FPermit      common.FPermit `yaml:"fpermit"`

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

	IngesterApi common.IngesterApi `yaml:"ingester-api"`
	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"`
	PrometheusCfg  prometheus.Config             `yaml:"prometheus"`
	HTTPCfg        http.Config                   `yaml:"http"`
}

type DFWebService

type DFWebService struct {
	Enabled bool   `default:"false" yaml:"enabled"`
	Host    string `default:"df-web" yaml:"host"`
	Port    int    `default:"20825" yaml:"port"`
	Timeout int    `default:"30" 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:"25" yaml:"data_source_max"`
	DataSourceRetentionTimeMax   int `default:"24000" yaml:"data_source_retention_time_max"`
	DataSourceExtMetricsInterval int `default:"10" yaml:"data_source_ext_metrics_interval"`
	DataSourcePrometheusInterval int `default:"10" yaml:"data_source_prometheus_interval"`
}

Jump to

Keyboard shortcuts

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