arguments

package
v0.0.0-...-c5d900d Latest Latest
Warning

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

Go to latest
Published: Jan 10, 2019 License: Apache-2.0 Imports: 11 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

View Source
var ConsumerTypes = map[string]ConsumerType{
	"stdout":        Stdout,
	"stderr":        Stderr,
	"file":          File,
	"redis":         Redis,
	"http":          HTTP,
	"rabbitmq":      Rabbit,
	"kafka":         Kafka,
	"elasticsearch": Elasticsearch,
}

Functions

This section is empty.

Types

type Args

type Args struct {
	SMTP          SMTPArgs
	Milter        MilterArgs
	HTTP          HTTPArgs
	Redis         RedisArgs
	Consumer      ConsumerArgs
	Logging       LoggingArgs
	Forward       ForwardArgs
	Collector     CollectorArgs
	Rabbit        RabbitArgs
	Kafka         KafkaArgs
	GeoIP         GeoIPArgs
	Elasticsearch ElasticsearchArgs
	Phishtank     PhishtankArgs
	Secret        *memguard.LockedBuffer `json:"-"`
	NbParsers     int
	NoDKIM        bool
	CacheDir      string
}

func GetArgs

func GetArgs(c *cli.Context) (*Args, error)

func (*Args) RedisRequired

func (args *Args) RedisRequired() bool

type CollectorArgs

type CollectorArgs struct {
	Type          string
	CollectorSize int
	CollectorDir  string
}

func (*CollectorArgs) Populate

func (args *CollectorArgs) Populate(c *cli.Context)

func (*CollectorArgs) Verify

func (args *CollectorArgs) Verify() error

type ConsumerArgs

type ConsumerArgs struct {
	Type    string
	OutFile string
	OutURL  string
}

func (ConsumerArgs) GetType

func (args ConsumerArgs) GetType() ConsumerType

func (ConsumerArgs) GetURL

func (args ConsumerArgs) GetURL() string

func (*ConsumerArgs) Populate

func (args *ConsumerArgs) Populate(c *cli.Context)

func (*ConsumerArgs) Verify

func (args *ConsumerArgs) Verify() error

type ConsumerType

type ConsumerType int
const (
	Stdout ConsumerType = iota
	Stderr
	File
	Redis
	HTTP
	Rabbit
	Kafka
	Elasticsearch
)

type ElasticsearchArgs

type ElasticsearchArgs struct {
	Nodes     []string
	IndexName string
}

func (*ElasticsearchArgs) Populate

func (args *ElasticsearchArgs) Populate(c *cli.Context)

func (*ElasticsearchArgs) Verify

func (args *ElasticsearchArgs) Verify() error

type ForwardArgs

type ForwardArgs struct {
	URL string
}

func (ForwardArgs) Parsed

func (args ForwardArgs) Parsed() (scheme, host, port, username, password string)

func (*ForwardArgs) Populate

func (args *ForwardArgs) Populate(c *cli.Context)

func (*ForwardArgs) Verify

func (args *ForwardArgs) Verify() error

type GeoIPArgs

type GeoIPArgs struct {
	Enabled      bool
	DatabasePath string
}

func (*GeoIPArgs) Populate

func (args *GeoIPArgs) Populate(c *cli.Context)

func (GeoIPArgs) Verify

func (args GeoIPArgs) Verify() error

type HTTPArgs

type HTTPArgs struct {
	HostPortAPI      string
	HostPortMaster   string
	ListenAddrAPI    string
	ListenPortAPI    int
	ListenAddrMaster string
	ListenPortMaster int
}

func (*HTTPArgs) Populate

func (args *HTTPArgs) Populate(c *cli.Context)

func (*HTTPArgs) Verify

func (args *HTTPArgs) Verify() error

type KafkaArgs

type KafkaArgs struct {
	Brokers []string
	Topic   string
}

func (*KafkaArgs) Populate

func (args *KafkaArgs) Populate(c *cli.Context)

func (*KafkaArgs) Verify

func (args *KafkaArgs) Verify() error

type LoggingArgs

type LoggingArgs struct {
	LogLevel string
	Syslog   bool
}

func (*LoggingArgs) Populate

func (args *LoggingArgs) Populate(c *cli.Context)

func (*LoggingArgs) Verify

func (args *LoggingArgs) Verify() error

type MilterArgs

type MilterArgs struct {
	ListenAddr string
	ListenPort int
	Inetd      bool
}

func (*MilterArgs) Populate

func (args *MilterArgs) Populate(c *cli.Context)

func (*MilterArgs) Verify

func (args *MilterArgs) Verify() error

type PhishtankArgs

type PhishtankArgs struct {
	ApplicationKey string
	CacheDir       string
	Active         bool
}

func (*PhishtankArgs) Populate

func (args *PhishtankArgs) Populate(c *cli.Context)

func (*PhishtankArgs) Verify

func (args *PhishtankArgs) Verify() error

type RabbitArgs

type RabbitArgs struct {
	URI                 string
	CollectorQueue      string
	CollectorExchange   string
	ResultsExchange     string
	ResultsExchangeType string
	ResultsRoutingKey   string
}

func (*RabbitArgs) Populate

func (args *RabbitArgs) Populate(c *cli.Context)

func (*RabbitArgs) Verify

func (args *RabbitArgs) Verify() error

type RedisArgs

type RedisArgs struct {
	URL          string
	ResultsKey   string
	CollectorKey string
}

func (*RedisArgs) Populate

func (args *RedisArgs) Populate(c *cli.Context)

func (*RedisArgs) Verify

func (args *RedisArgs) Verify() error

type SMTPArgs

type SMTPArgs struct {
	ListenAddr     string
	ListenPort     int
	MaxMessageSize int
	MaxIdle        int
	Inetd          bool
}

func (*SMTPArgs) Populate

func (args *SMTPArgs) Populate(c *cli.Context)

func (*SMTPArgs) Verify

func (args *SMTPArgs) Verify() error

Jump to

Keyboard shortcuts

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