app

package
v0.11.0 Latest Latest
Warning

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

Go to latest
Published: Apr 5, 2018 License: Apache-2.0 Imports: 16 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

View Source
var Opts struct {
	ConfFile  string        `` /* 129-byte string literal not displayed */
	Reader    string        `long:"reader" env:"READER" default:"localhost:1234/debug/vars" description:"Target address and port"`
	Recorder  string        `long:"recorder" env:"RECORDER" default:"localhost:9200" description:"Elasticsearch URL and port"`
	LogLevel  string        `long:"loglevel" env:"LOGLEVEL" default:"info" description:"Log level"`
	IndexName string        `long:"index" env:"INDEX" default:"expipe" description:"Elasticsearch index name"`
	TypeName  string        `long:"type" env:"TYPE" default:"expipe" description:"Elasticsearch type name"`
	Interval  time.Duration `long:"int" env:"INT" default:"1s" description:"Interval between pulls from the target"`
	Timeout   time.Duration `long:"timeout" env:"TIMEOUT" default:"30s" description:"Communication time-outs to both reader and recorder"`
	Backoff   int           `long:"backoff" env:"BACKOFF" default:"15" description:"After this amount, it will give up accessing unresponsive endpoints"`
}

Opts is the command line flag struct. IDEA: create an interactive wizard for creating a config file.

Functions

func CaptureSignals

func CaptureSignals(cancel context.CancelFunc, sigCh chan os.Signal, exit func(int), timeout time.Duration)

CaptureSignals cancels the context if receives the SIGINT or SIGTERM signal through sigCh, and exits with calling exit(130).

func Config

func Config() (*tools.Logger, *config.ConfMap, error)

Config returns the ConfMap from a file if it was set in the command flags.

func Main

func Main()

Main is the entrypoint of the application. It is been called from the main.main

Types

This section is empty.

Jump to

Keyboard shortcuts

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