cli

package
v0.23.0 Latest Latest
Warning

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

Go to latest
Published: Jan 4, 2022 License: Apache-2.0 Imports: 18 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func WithContext

func WithContext(runner Runner) 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 Input added in v0.20.0

type Input struct {
	Logger *zap.Logger
	Flags  TelemetryFlags
	Stdin  io.Reader
}

func (Input) CustomMetricsHandlerFor added in v0.20.0

func (t Input) CustomMetricsHandlerFor(reg prometheus.Gatherer, mb MetricsBuilder) http.Handler

func (Input) PrometheusMetricsHandler added in v0.20.0

func (t Input) PrometheusMetricsHandler() http.Handler

func (Input) PrometheusMetricsHandlerFor added in v0.20.0

func (t Input) PrometheusMetricsHandlerFor(r *prometheus.Registry) http.Handler

type MetricsBuilder added in v0.11.1

type MetricsBuilder interface {
	Build() (io.Reader, error)
}

type Runner added in v0.1.1

type Runner func(ctx context.Context, input Input) error

type TelemetryFlags

type TelemetryFlags struct {
	LogLevel                string
	LogEncoding             string
	Profile                 bool
	ProfileDebugLogging     bool
	ProfilerCredentialsFile string
	Metrics                 bool
}

Jump to

Keyboard shortcuts

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