cli

package
v0.0.0-...-382bf78 Latest Latest
Warning

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

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

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func Context

func Context(c *cli.Context) source.Option

Context sets the cli context

func NewSource

func NewSource(opts ...source.Option) source.Source

NewSource returns a config source for integrating parsed flags from a micro/cli.Context. Hyphens are delimiters for nesting, and all keys are lowercased. The assumption is that command line flags have already been parsed.

Example:

cli.StringFlag{Name: "db-host"},

{
    "database": {
        "host": "localhost"
    }
}

func WithContext

func WithContext(ctx *cli.Context, opts ...source.Option) source.Source

WithContext returns a new source with the context specified. The assumption is that Context is retrieved within an app.Action function.

Types

This section is empty.

Jump to

Keyboard shortcuts

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