flag

package
v0.2.2 Latest Latest
Warning

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

Go to latest
Published: Dec 7, 2021 License: Apache-2.0 Imports: 5 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type Cli

type Cli struct {
	// contains filtered or unexported fields
}

Cli implements a urfave/cli command line provider.

func Provider

func Provider(ctx *cli.Context, flagDelim string, ko *koanf.Koanf) *Cli

Provider returns a commandline flags provider that returns a nested map[string]interface{} where the nesting hierarchy of keys are defined by flagDelim. For instance, the flagDelim "." will convert the flag name `parent.child.key: 1` to `{parent: {child: {key: 1}}}`. It takes an optional (but recommended) Koanf instance to see if the the flags defined have been set from other providers, for instance, a config file. If they are not, then the default values of the flags are merged. If they do exist, the flag values are not merged but only the values that have been explicitly set in the command line are merged.

func (*Cli) Read

func (p *Cli) Read() (map[string]interface{}, error)

Read reads the flag variables and returns a nested conf map.

func (*Cli) ReadBytes

func (p *Cli) ReadBytes() ([]byte, error)

ReadBytes is not supported.

func (*Cli) Watch

func (p *Cli) Watch(cb func(event interface{}, err error)) error

Watch is not supported.

Jump to

Keyboard shortcuts

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