extkingpin

package
v0.32.5 Latest Latest
Warning

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

Go to latest
Published: Oct 19, 2023 License: Apache-2.0 Imports: 18 Imported by: 2

Documentation

Index

Constants

View Source
const UsageTemplate = `` /* 1202-byte string literal not displayed */

Variables

This section is empty.

Functions

func Addrs added in v0.24.0

func Addrs(flags *kingpin.FlagClause) (target *addressSlice)

func ModelDuration added in v0.17.0

func ModelDuration(flags *kingpin.FlagClause) *model.Duration

func NewStaticPathContent added in v0.29.0

func NewStaticPathContent(fromPath string) (*staticPathContent, error)

NewStaticPathContent creates a new content that can be used to serve a static configuration. It copies the configuration from `fromPath` into `destPath` to avoid confusion with file watchers.

func PathContentReloader added in v0.29.0

func PathContentReloader(ctx context.Context, fileContent fileContent, logger log.Logger, reloadFunc func(), debounceTime time.Duration) error

PathContentReloader runs the reloadFunc when it detects that the contents of fileContent have changed.

func RegisterCommonObjStoreFlags added in v0.17.0

func RegisterCommonObjStoreFlags(cmd FlagClause, suffix string, required bool, extraDesc ...string) *extflag.PathOrContent

RegisterCommonObjStoreFlags register flags to specify object storage configuration.

func RegisterCommonTracingFlags added in v0.17.0

func RegisterCommonTracingFlags(app FlagClause) *extflag.PathOrContent

RegisterCommonTracingFlags registers flags to pass a tracing configuration to be used with OpenTracing.

func RegisterHTTPFlags added in v0.17.0

func RegisterHTTPFlags(cmd FlagClause) (httpBindAddr *string, httpGracePeriod *model.Duration, httpTLSConfig *string)

RegisterCommonObjStoreFlags register flags commonly used to configure http servers with.

func RegisterRequestLoggingFlags added in v0.20.0

func RegisterRequestLoggingFlags(app FlagClause) *extflag.PathOrContent

RegisterRequestLoggingFlags registers flags to pass a request logging configuration to be used.

func RegisterSelectorRelabelFlags added in v0.17.0

func RegisterSelectorRelabelFlags(cmd FlagClause) *extflag.PathOrContent

RegisterSelectorRelabelFlags register flags to specify relabeling configuration selecting blocks to process.

Types

type App

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

App is a wrapper around kingping.Application for easier use.

func NewApp

func NewApp(app *kingpin.Application) *App

NewApp returns new App.

func (*App) Command

func (a *App) Command(cmd, help string) AppClause

func (*App) Parse

func (a *App) Parse() (cmd string, setup SetupFunc)

type AppClause

type AppClause interface {
	FlagClause
	Command(cmd string, help string) AppClause
	Flags() []*kingpin.FlagModel
	Setup(s SetupFunc)
}

type FlagClause

type FlagClause interface {
	Flag(name, help string) *kingpin.FlagClause
}

type SetupFunc

type SetupFunc func(*run.Group, log.Logger, *prometheus.Registry, opentracing.Tracer, <-chan struct{}, bool) error

TODO(bwplotka): Consider some extkingpin package that will not depend on those. Needed: Generics!

Jump to

Keyboard shortcuts

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