program

package
v0.0.0-...-0c0344b Latest Latest
Warning

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

Go to latest
Published: Apr 26, 2023 License: MIT Imports: 14 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

View Source
var Version = "unknown"

Functions

This section is empty.

Types

type Monitor

type Monitor struct {
	SaveTo string `group:"save" help:"Save the current monitor configuration to a file" type:"existingdir"`
}

func (*Monitor) Run

func (program *Monitor) Run(options *Options) error

Run runs the program

func (*Monitor) SaveMonitors

func (program *Monitor) SaveMonitors(monitors []datadogV1.Monitor) error

SaveMonitors saves the given monitors to the directory in program.SaveTo

type Options

type Options struct {
	Version bool `help:"Show program version"`

	DatadogApiKey string `help:"Datadog API key" env:"DD_API_KEY"`
	DatadogAppKey string `help:"Datadog APP key" env:"DD_APP_KEY"`

	Debug        bool    `group:"Info" help:"Show debugging information"`
	OutputFormat string  `group:"Info" enum:"auto,jsonl,terminal" default:"auto" help:"How to show program output (auto|terminal|jsonl)"`
	Quiet        bool    `group:"Info" help:"Be less verbose than usual"`
	Monitor      Monitor `cmd:"" help:"Manipulate monitors"`
}

Options is the structure of program options

func (*Options) AfterApply

func (program *Options) AfterApply() error

AfterApply runs after the options are parsed but before anything runs

func (*Options) Client

func (program *Options) Client(ctx context.Context) (*datadog.APIClient, context.Context)

func (*Options) Parse

func (program *Options) Parse(args []string) (*kong.Context, error)

Parse calls the CLI parsing routines

func (*Options) Run

func (program *Options) Run(_ *Options) error

Run runs the program

type VersionCmd

type VersionCmd struct{}

VersionCmd prints the program version

func (*VersionCmd) Run

func (v *VersionCmd) Run(program *Options) error

Jump to

Keyboard shortcuts

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