controller

package
v1.0.0 Latest Latest
Warning

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

Go to latest
Published: Jul 12, 2020 License: MIT Imports: 10 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type Controller

type Controller struct {
	Exec    Executor
	DataDog DataDogClient
	Now     func() time.Time
	Since   func(time.Time) time.Duration
}

func New

func New(apiKey string) Controller

func (Controller) Main

func (ctrl Controller) Main(ctx context.Context, params Params) int

type DataDogClient

type DataDogClient interface {
	Send(ddog.Params) error
}

type Executor

type Executor interface {
	Run(ctx context.Context, arg string, args ...string) error
}

type Params

type Params struct {
	Append        bool
	MetricName    string
	MetricHost    string
	DataDogAPIKey string
	Output        string
	Args          []string
	Tags          []string
}

Jump to

Keyboard shortcuts

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