yaml

package
v1.0.0 Latest Latest
Warning

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

Go to latest
Published: Jul 23, 2018 License: MIT Imports: 2 Imported by: 0

README

yaml GoDoc

YAML Source and Extractor for flagga.

Install

go get -v github.com/erizocosmico/flaggax/yaml

Usage


import (
    "github.com/erizocosmico/flagga"
    "github.com/erizocosmico/flaggax/yaml"
)

//...

var fs flagga.FlagSet

db := fs.String("db", defaultDBURI, "database connection string", yaml.Key("db_uri"))
users := fs.StringList("users", nil, "list of allowed users", yaml.Key("users"))

err := fs.Parse(os.Args[1:], yaml.Via("config.yaml"))
if err != nil {
    // handle err
}

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func Key

func Key(key string) flagga.Extractor

Key returns an Extractor that will match the given key in a provided YAML file to set as value for the flag.

func Via

func Via(file string) flagga.Source

Via returns a Source that will use a YAML file as a provider of flag values.

Types

This section is empty.

Jump to

Keyboard shortcuts

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