cli

package
v0.0.2 Latest Latest
Warning

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

Go to latest
Published: Jun 12, 2020 License: Apache-2.0 Imports: 18 Imported by: 0

Documentation

Index

Constants

View Source
const (
	PrometheusExporter  = "prometheus"
	StackdriverExporter = "stackdriver"
)

Variables

This section is empty.

Functions

func WithContext

func WithContext(piped Piped) func(cmd *cobra.Command, args []string) error

Types

type App

type App struct {
	// contains filtered or unexported fields
}

func NewApp

func NewApp(name, desc string) *App

func (*App) AddCommands

func (a *App) AddCommands(cmds ...*cobra.Command)

func (*App) Run

func (a *App) Run() error

type Piped

type Piped func(ctx context.Context, telemetry Telemetry) error

type Telemetry

type Telemetry struct {
	Logger          *zap.Logger
	MetricsExporter view.Exporter
	TracingExporter trace.Exporter
	Flags           TelemetryFlags
}

func (Telemetry) PrometheusMetricsExporter

func (t Telemetry) PrometheusMetricsExporter() (*prometheus.Exporter, bool)

type TelemetryFlags

type TelemetryFlags struct {
	LogLevel                   string
	LogEncoding                string
	Profile                    bool
	ProfileDebugLogging        bool
	ProfilerCredentialsFile    string
	Metrics                    bool
	MetricsExporter            string
	Tracing                    bool
	TracingExporter            string
	StackdriverProjectID       string
	StackdriverCredentialsFile string
}

Jump to

Keyboard shortcuts

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