Documentation ¶
Index ¶
- func GetCreds(cfg *TLSConfig) (credentials.TransportCredentials, error)
- func GetDefaultLogger() *zap.Logger
- func GetLogger(zCfg *zap.Config) *zap.Logger
- func GetTLS(cfg *TLSConfig) (*tls.Config, error)
- func Transform(cfg interface{}, d interface{}) error
- type Config
- type EgressConfig
- type Field
- type Flow
- type Geo
- type Ingestion
- type Ingress
- type MemSink
- type ServerConfig
- type TLSConfig
- type Tracepoint
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
func GetCreds ¶
func GetCreds(cfg *TLSConfig) (credentials.TransportCredentials, error)
GetCreds returns transport credentials based on the tls config.
func GetDefaultLogger ¶
GetDefaultLogger creates default zap logger.
Types ¶
type Config ¶
type Config struct { Tracepoints []Tracepoint Fields map[string][]Field Egress map[string]EgressConfig Log *zap.Config // contains filtered or unexported fields }
Config represents tcpstats's config
func FromContext ¶
FromContext returns configuration from context.
func (*Config) GetTPFields ¶
GetTPFields returns a tracepoint fields.
func (*Config) SetMockLogger ¶
SetMockLogger sets in memory logger
type EgressConfig ¶
EgressConfig represents egress configuration.
type Field ¶
type Field struct { Name string `yaml:"name"` Math string `yaml:"math,omitempty"` Filter string `yaml:"filter,omitempty"` }
Field represents a field.
type MemSink ¶
MemSink represents logging in memory
type ServerConfig ¶
type ServerConfig struct { Ingress map[string]Ingress Ingestion map[string]Ingestion Flow []Flow Geo Geo Log *zap.Config // contains filtered or unexported fields }
ServerConfig represents server configuration
func FromContextServer ¶
func FromContextServer(ctx context.Context) *ServerConfig
FromContextServer returns configuration from context
func GetServer ¶
func GetServer(args []string, version string) (*ServerConfig, error)
GetServer returns configuration
func (*ServerConfig) SetMockLogger ¶
func (c *ServerConfig) SetMockLogger(scheme string) *MemSink
SetMockLogger sets the in memory logger
func (*ServerConfig) WithContext ¶
func (c *ServerConfig) WithContext(ctx context.Context) context.Context
WithContext returns new context including configuration
Click to show internal directories.
Click to hide internal directories.