cli

package
v0.47.1 Latest Latest
Warning

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

Go to latest
Published: Apr 22, 2024 License: Apache-2.0 Imports: 19 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

View Source
var ErrFlagParse = errors.New("FlagParseErr")

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