cli

package
v0.41.3 Latest Latest
Warning

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

Go to latest
Published: Jan 13, 2023 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

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

func (Input) CustomMetricsHandlerFor

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

func (Input) PrometheusMetricsHandler

func (t Input) PrometheusMetricsHandler() http.Handler

func (Input) PrometheusMetricsHandlerFor

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

type MetricsBuilder

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

type Runner

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