Documentation ¶
Index ¶
Constants ¶
This section is empty.
Variables ¶
var (
ErrNotPointer = errors.New("dst is not a pointer")
)
Functions ¶
Types ¶
type Cloneable ¶
type Cloneable interface {
Clone() flagext.Registerer
}
Cloneable is a config which can be cloned into a flagext.Registerer Contract: the cloned value must not mutate the original.
type Source ¶
Source is a generic configuration source. This function may do whatever is required to obtain the configuration. It is passed a pointer to the destination, which will be something compatible to `json.Unmarshal`. The obtained configuration may be written to this object, it may also contain data from previous sources.
func Defaults ¶
func Defaults() Source
Defaults registers flags to the command line using dst as the flagext.Registerer
func Flags ¶
func Flags() Source
Flags parses the flag from the command line, setting only user-supplied values on the flagext.Registerer passed to Defaults()
func YAML ¶
YAML returns a Source that opens the supplied `.yaml` file and loads it. When expandEnvVars is true, variables in the supplied '.yaml\ file are expanded using https://pkg.go.dev/github.com/drone/envsubst?tab=overview