go-micro: github.com/micro/go-micro/config/source/cli Index | Files

package cli

import "github.com/micro/go-micro/config/source/cli"


Package Files

cli.go options.go util.go

func Context Uses

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

Context sets the cli context

func NewSource Uses

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.


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

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

func WithContext Uses

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.

Package cli imports 11 packages (graph) and is imported by 2 packages. Updated 2020-02-22. Refresh now. Tools for package owners.