cli

package
v0.2.2 Latest Latest
Warning

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

Go to latest
Published: Aug 22, 2024 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 Cli

type Cli struct{}

func (*Cli) Run

func (c *Cli) Run()

type Globals

type Globals struct {
	Version VersionFlag `name:"version" short:"v" help:"print version and quit"`
}

type MetricsCmd

type MetricsCmd struct {
	Post MetricsPostCmd `cmd:"post" help:"post a metric datapoint"`
}

type MetricsPostCmd

type MetricsPostCmd struct {
	OTLPEndpoint       string            `name:"otlp-endpoint" required:"" env:"OTEL_EXPORTER_OTLP_ENDPOINT,OTEL_EXPORTER_OTLP_METRICS_ENDPOINT" help:"OTLP endpoint"`
	OTLPHeaders        map[string]string `name:"otlp-headers" mapsep:"," env:"OTEL_EXPORTER_OTLP_HEADERS,OTEL_EXPORTER_OTLP_METRICS_HEADERS" help:"OTLP headers"`
	OTLPProtocol       string            `name:"otlp-protocol" env:"OTEL_EXPORTER_OTLP_PROTOCOL" default:"grpc" enum:"grpc,http" help:"OTLP protocol"`
	OTLPInsecure       bool              `name:"otlp-insecure" help:"disable secure connection (required for such as localhost)"`
	MetricName         string            `name:"name" short:"n" required:"" help:"metric name"`
	MetricType         string            `name:"type" short:"t" default:"gauge" enum:"gauge,sum" help:"metric type"`
	MetricDescription  string            `name:"description" short:"d" help:"metric description"`
	MetricUnit         string            `name:"unit" short:"u" default:"1" help:"metric unit"`
	ResourceAttrs      map[string]string `name:"resource-attrs" mapsep:"," help:"resource attributes"`
	DataPointAttrs     map[string]string `name:"datapoint-attrs" mapsep:"," aliases:"attrs" help:"datapoint attributes"`
	DataPointTimestamp int64             `name:"timestamp" help:"datapoint timestamp (unix seconds)"`
	DataPointValue     float64           `arg:"" required:"" help:"datapoint value"`
}

func (*MetricsPostCmd) Run

func (c *MetricsPostCmd) Run(globals *Globals) error

type VersionCmd

type VersionCmd struct{}

func (*VersionCmd) Run

func (c *VersionCmd) Run(globals *Globals) error

type VersionFlag

type VersionFlag string

func (VersionFlag) BeforeApply

func (v VersionFlag) BeforeApply(app *kong.Kong, vars kong.Vars) error

func (VersionFlag) Decode

func (v VersionFlag) Decode(ctx *kong.DecodeContext) error

func (VersionFlag) IsBool

func (v VersionFlag) IsBool() bool

Jump to

Keyboard shortcuts

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