envflags

package module
v0.0.0-...-2faaef9 Latest Latest
Warning

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

Go to latest
Published: Jul 29, 2019 License: MIT Imports: 4 Imported by: 0

README

Build Status codecov GolangCI

Documentation

Index

Constants

This section is empty.

Variables

View Source
var (
	DefaultConfig Config
	DefaultFlags  *pflag.FlagSet
	DefaultEnv    []string
)

Functions

func Apply

func Apply() error

func ApplyTo

func ApplyTo(flags *pflag.FlagSet) error

func ApplyWith

func ApplyWith(env []string, flags *pflag.FlagSet) error

Types

type Config

type Config struct {
	Prefix      string
	TransformFn TransformFn
	NameFn      NameFn
	Override    bool
}

func NewConfig

func NewConfig() Config

type Envflags

type Envflags interface {
	ApplyTo(flags *pflag.FlagSet) error
	ApplyWith(env []string, flags *pflag.FlagSet) error
}

func New

func New(cfg Config) Envflags

type NameFn

type NameFn func(prefix string, flagName string) string

type TransformFn

type TransformFn func(name string) string

Jump to

Keyboard shortcuts

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