cfg

package
v0.0.1-bate.9 Latest Latest
Warning

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

Go to latest
Published: Jan 13, 2022 License: Apache-2.0 Imports: 4 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func IsMetricsConfigFullyOverridden

func IsMetricsConfigFullyOverridden(c *OperationsConfigOptions) bool

IsMetricsConfigFullyOverridden will return true if all of the argument's sub interfaces is not nil (ie MetricsConfig interface not fully overridden)

Types

type MetricConfig

type MetricConfig struct {
	// Provider : statsd, prometheus, or disabled
	Provider string
	// Statsd represents metrics config for Statsd provider
	Statsd Statsd
}

MetricConfig defines a metric configuration used along the operation system config

type MetricsConfig

type MetricsConfig interface {
	OperationCfg() OperationConfig
	MetricCfg() MetricConfig
}

MetricsConfig contains operations system and metrics configuration

func BuildConfigMetricsFromOptions

func BuildConfigMetricsFromOptions(opts ...interface{}) (MetricsConfig, error)

BuildConfigMetricsFromOptions will return a MetricsConfig instance pre-built with Optional interfaces provided in fabsdk's WithMetricsConfig(opts...) call

func ConfigFromBackend

func ConfigFromBackend(coreBackend ...core.ConfigBackend) (MetricsConfig, error)

ConfigFromBackend returns identity config implementation of given backend

func UpdateMissingOptsWithDefaultConfig

func UpdateMissingOptsWithDefaultConfig(c *OperationsConfigOptions, d MetricsConfig) MetricsConfig

UpdateMissingOptsWithDefaultConfig will verify if any functions of the MetricsConfig were not updated with fabsdk's WithConfigMetrics(opts...) call, then use default MetricsConfig interface for these functions instead

type MetricsConfigImpl

type MetricsConfigImpl struct {
	OperationConfig
	MetricConfig
	// contains filtered or unexported fields
}

MetricsConfigImpl is the default implementation of MetricsConfig holding config data loaded from backend

func (*MetricsConfigImpl) MetricCfg

func (m *MetricsConfigImpl) MetricCfg() MetricConfig

MetricCfg returns the metrics Config

func (*MetricsConfigImpl) OperationCfg

func (m *MetricsConfigImpl) OperationCfg() OperationConfig

OperationCfg returns the oeprations Config

type OperationConfig

type OperationConfig struct {
	TLSEnabled         bool
	ClientAuthRequired bool
	ListenAddress      string

	// TODO replace TLSCertFile, TLCKeyFile and ClientRootCAs to TLSCACerts (here and in the configs as well)
	TLSCertFile   string
	TLSKeyFile    string
	ClientRootCAs []string
}

OperationConfig defines an operations system configuration

type OperationsConfigOptions

type OperationsConfigOptions struct {
	// contains filtered or unexported fields
}

OperationsConfigOptions represents MetricsConfig interface with overridable interface functions if a function is not overridden, the default MetricsConfig implementation will be used.

type Statsd

type Statsd struct {
	// Network is statsd network type: tcp or udp
	Network string

	// Address is statsd server address: 127.0.0.1:8125
	Address string

	// WriteInterval is the interval at which locally cached counters and gauges are pushed
	// to statsd; timings are pushed immediately
	WriteInterval time.Duration

	// prefix is prepended to all emitted statsd metrics
	Prefix string
}

Statsd config useful for Statsd metrics provider

Jump to

Keyboard shortcuts

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