appflag

package
v0.26.0 Latest Latest
Warning

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

Go to latest
Published: Oct 13, 2020 License: Apache-2.0 Imports: 11 Imported by: 0

Documentation

Overview

Package appflag contains functionality to work with flags.

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type Builder

type Builder interface {
	BindRoot(flagSet *pflag.FlagSet)
	NewRunFunc(func(context.Context, Container) error) func(context.Context, app.Container) error
}

Builder builds run functions.

func NewBuilder

func NewBuilder(appName string, options ...BuilderOption) Builder

NewBuilder returns a new Builder.

type BuilderOption

type BuilderOption func(*builder)

BuilderOption is an option for a new Builder

func BuilderWithTimeout

func BuilderWithTimeout(defaultTimeout time.Duration) BuilderOption

BuilderWithTimeout returns a new BuilderOption that adds a timeout flag and the default timeout.

func BuilderWithTracing added in v0.25.0

func BuilderWithTracing() BuilderOption

BuilderWithTracing enables zap tracing for the builder.

type Container added in v0.25.0

type Container interface {
	app.Container
	appname.Container
	applog.Container
}

Container is a container.

Jump to

Keyboard shortcuts

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