cli

package
v0.0.0-...-d8c2abc Latest Latest
Warning

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

Go to latest
Published: Oct 3, 2018 License: MIT Imports: 16 Imported by: 0

Documentation

Index

Constants

View Source
const (
	ExitCodeOK    int = 0
	ExitCodeError int = 1 + iota
)

Exit codes are int values that represent an exit code for a particular error.

Variables

This section is empty.

Functions

func ConfigUsage

func ConfigUsage(w io.Writer) error

ConfigUsage lists the environment variables to be used for configuration

Types

type CLI

type CLI struct {
	// OutStream and ErrStream are the stdout and stderr to write message from the CLI.
	OutStream, ErrStream io.Writer
	Conf                 *Config
	//LogLevel string
	Logger *log.Logger
}

CLI is the command line object

func (*CLI) CGErrorsCheck

func (cli *CLI) CGErrorsCheck(consumer *input.KafkaConsumer)

func (*CLI) CacheEvict

func (cli *CLI) CacheEvict(cache enricher.Enricher)

func (*CLI) CacheRefresh

func (cli *CLI) CacheRefresh(cache enricher.Enricher, negativeCache enricher.Enricher, cfclient *enricher.CFClient)

func (*CLI) EnricherChain

func (cli *CLI) EnricherChain(stats *debug.Stats) (*enricher.CFClient, enricher.Enricher, enricher.Enricher, error)

func (*CLI) InputChain

func (cli *CLI) InputChain() (*input.KafkaConsumer, error)

func (*CLI) Name

func (_ *CLI) Name() string

func (*CLI) NegativeCacheEvict

func (cli *CLI) NegativeCacheEvict(negativeCache enricher.Enricher)

func (*CLI) OutputChain

func (cli *CLI) OutputChain(consumer *input.KafkaConsumer, stats *debug.Stats) (output.AsyncWriter, error)

func (*CLI) Process

func (cli *CLI) Process(consumer input.Reader, cache enricher.Enricher, batcher output.AsyncWriter, stats *debug.Stats) error

func (*CLI) Run

func (cli *CLI) Run(logger *log.Logger) int

Run invokes the CLI

func (*CLI) StatsEmit

func (cli *CLI) StatsEmit(stats *debug.Stats)

func (*CLI) TrapSignals

func (cli *CLI) TrapSignals(consumer *input.KafkaConsumer)

func (*CLI) Version

func (_ *CLI) Version() string

type Config

type Config struct {
	CF       enricher.ConfigCF
	InfluxDB output.ConfigInfluxDB
	Batcher  output.ConfigBatcher
	Kafka    input.ConfigKafka
	Server   debug.ConfigServer

	MetadataRefresh          time.Duration `default:"10m" desc:"How often to fetch a fresh copy of all metadata"`
	MetadataExpire           time.Duration `default:"3m" desc:"How long before metadata is considered expired"`
	MetadataExpireCheck      time.Duration `default:"1m" desc:"How often to check for expired metadata"`
	NegativeCacheExpire      time.Duration `default:"20m" desc:"How long before negative cache is considered expired"`
	NegativeCacheExpireCheck time.Duration `default:"3m" desc:"How often to check for expired negative cache"`
}

Config is the root configuration structure

func ConfigParse

func ConfigParse() (*Config, error)

ConfigParse parses the CFMR_* environment vars to extract the configuration

Jump to

Keyboard shortcuts

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