cmd

package
v0.0.0-...-42b0dcf Latest Latest
Warning

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

Go to latest
Published: Aug 13, 2019 License: MIT Imports: 18 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

View Source
var BQFlags = map[string]Flag{
	"project": Flag{
		Name:      "project",
		ShortName: "p",
		Usage:     "`project name`",
	},
	"dataset": Flag{
		Name:      "dataset",
		ShortName: "d",
		Usage:     "`Name of dataset to ship to`",
	},
	"table": Flag{
		Name:      "table",
		ShortName: "t",
		Usage:     "`Name of table to ship to`",
	},
	"serviceaccount": Flag{
		Name:      "serviceaccount",
		ShortName: "s",
		Usage:     "`path to json file with service account credentials`",
	},
}

BQFlags defines the subcomands for bigquery

View Source
var InfluxFlags = map[string]Flag{
	"database": Flag{
		Name:      "database",
		ShortName: "d",
		Usage:     "`Name of database to ship to`",
	},
	"serie": Flag{
		Name:      "serie",
		ShortName: "s",
		Usage:     "`Name of time serie to ship to`",
	},
	"connection": Flag{
		Name:      "connection",
		ShortName: "c",
		Usage:     "`Connection string to influx DB`",
	},
}

Functions

func Cleanup

func Cleanup()

func NewHPTailer

func NewHPTailer(parser Parser, logFileToTail string) (*tailer, error)

func Parse

func Parse(logRow string) (string, error)

func Send

func Send(message string) error

func SetupParser

func SetupParser(p Parser)

func SetupService

func SetupService(s Stash)

func SetupTail

func SetupTail(t Tail)

func Start

func Start()

func WireUp

func WireUp(c *cli.Context) error

WireUp validates flags and set up dependencies

Types

type Flag

type Flag struct {
	Name      string
	ShortName string
	Usage     string
}

type Parser

type Parser interface {
	Parse(logRow string) (string, error)
}

func NewParser

func NewParser(regex, dateLayout string, parser func(string) (string, error)) Parser

NewParser returns a Parser that can be used to parse logfiles

type Stash

type Stash interface {
	Send(message string) error
}

func NewBqService

func NewBqService(project, dataset, table, credentials string) (Stash, error)

NewBqService conects to BigQuery and returns a new Stash with configuration

func NewInfluxService

func NewInfluxService(database, serie, credentials string) (Stash, error)

NewInfluxService conects to influxDB and returns a new Stash

type Tail

type Tail interface {
	Start()
	Cleanup()
}

Jump to

Keyboard shortcuts

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