config

package
v0.1.0 Latest Latest
Warning

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

Go to latest
Published: Jun 2, 2022 License: Apache-2.0 Imports: 8 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

View Source
var (
	ErrNoInputConfigured        = errors.New("no input configured")
	ErrNoPortConfiguredForInput = errors.New("no port configured for input")
)
View Source
var (
	ErrNoOutputConfigured              = errors.New("no output configured")
	ErrNoPortConfiguredForServerOutput = errors.New("no port configured for server output")
)

Functions

func ValidateReceiverConfig

func ValidateReceiverConfig(config *Config) error

func ValidateSensorConfig

func ValidateSensorConfig(config *Config) error

Types

type AuthConfig

type AuthConfig struct {
	Enable bool
	Key    string
}

type Config

type Config struct {
	Input                  *InputConfig
	Output                 OutputConfig
	TLS                    TLSConfig
	Auth                   AuthConfig
	InputPacketLen         int
	LogFilename            string
	PcapMode               PcapMode
	CapturePorts           []int
	CaptureInterfacesPorts map[string][]int
	IgnorePorts            []int
	SamplingRate           SamplingRateConfig
	MaxEncodedLen          int
	MaxGatherLen           int
	MaxPayloadLen          int
	MaxHeaderLen           int
}

func NewConfig

func NewConfig(configFileName string) (*Config, error)

type FileOutputConfig

type FileOutputConfig struct {
	Path string
}

type InputConfig

type InputConfig struct {
	Address string
	Port    *int
}

type KafkaOutputRawConfig

type KafkaOutputRawConfig struct {
	Brokers     string
	ClientId    *string `yaml:"clientId,omitempty"`
	Topic       *string `yaml:"topic,omitempty"`
	MessageSize *string `yaml:"messageSize,omitempty"`
	Acks        *string `yaml:"acks,omitempty"`
	FileSize    *string `yaml:"fileSize,omitempty"`
}

type KafkaPluginConfig

type KafkaPluginConfig struct {
	Brokers     string
	ClientId    string             `yaml:"clientId,omitempty"`
	Topic       string             `yaml:"topic,omitempty"`
	MessageSize *bytesize.ByteSize `yaml:"messageSize,omitempty"`
	Acks        string             `yaml:"acks,omitempty"`
	FileSize    *bytesize.ByteSize `yaml:"fileSize,omitempty"`
}

type OutputConfig

type OutputConfig struct {
	File    *FileOutputConfig
	Server  *ServerOutputConfig
	Plugins *PluginsConfig
}

type OutputRawConfig

type OutputRawConfig struct {
	File    *FileOutputConfig
	Server  *ServerOutputConfig
	Plugins *PluginsRawConfig
}

type PcapMode

type PcapMode int
const (
	Allow PcapMode = iota
	Deny
	All
)

type PluginsConfig

type PluginsConfig struct {
	S3    *S3PluginConfig
	Kafka *KafkaPluginConfig
}

type PluginsRawConfig

type PluginsRawConfig struct {
	S3    *S3OutputRawConfig
	Kafka *KafkaOutputRawConfig
}

type RawConfig

type RawConfig struct {
	Input                  *InputConfig
	Output                 *OutputRawConfig
	TLS                    TLSConfig
	Auth                   AuthConfig
	CompressBlockSize      *int             `yaml:"compressBlockSize,omitempty"`
	InputPacketLen         *int             `yaml:"inputPacketLen,omitempty"`
	LogFilename            string           `yaml:"logFilename,omitempty"`
	PcapMode               string           `yaml:"pcapMode,omitempty"`
	CapturePorts           []int            `yaml:"capturePorts,omitempty"`
	CaptureInterfacesPorts map[string][]int `yaml:"captureInterfacesPorts,omitempty"`
	IgnorePorts            []int            `yaml:"ignorePorts,omitempty"`
}

type S3OutputRawConfig

type S3OutputRawConfig struct {
	Bucket          string
	Region          string
	TotalFileSize   *string `yaml:"totalFileSize,omitempty"`
	UploadChunkSize *string `yaml:"uploadChunkSize,omitempty"`
	UploadTimeout   *string `yaml:"uploadTimeout,omitempty"`
	CannedACL       *string `yaml:"cannedACL,omitempty"`
}

type S3PluginConfig

type S3PluginConfig struct {
	Region          string
	Bucket          string
	TotalFileSize   *bytesize.ByteSize `yaml:"totalFileSize,omitempty"`
	UploadChunkSize *bytesize.ByteSize `yaml:"uploadChunkSize,omitempty"`
	UploadTimeout   time.Duration      `yaml:"uploadTimeout,omitempty"`
	CannedACL       string             `yaml:"cannedACL,omitempty"`
}

type SamplingRateConfig

type SamplingRateConfig struct {
	MaxPktsToWrite int
	MaxTotalPkts   int
}

type ServerOutputConfig

type ServerOutputConfig struct {
	Address string
	Port    *int
}

type TLSConfig

type TLSConfig struct {
	Enable   bool
	CertFile string
	KeyFile  string
}

Jump to

Keyboard shortcuts

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