Documentation ¶
Index ¶
- func AddYamlReferences(subPackageOptionData []pflags.OptionData, fieldPointerValues []interface{}) (optionDataList []pflags.OptionData)
- func ApplyYaml(program, yamlFile, yamlDictionaryKey string, doYaml bool, ...) (err error)
- func FindFile(filename, program string) (readFilename string, byts []byte, err error)
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
func AddYamlReferences ¶
func AddYamlReferences( subPackageOptionData []pflags.OptionData, fieldPointerValues []interface{}, ) (optionDataList []pflags.OptionData)
AddYamlReferences returns a pflags.OptionData slice of options to main
- return value is appended to the pflags.OptionData list in main
- filedPointerValues is a list of references to main’s y YamlData
- subPackageOptionData is a list of options declared in subpackage
func ApplyYaml ¶
func ApplyYaml( program, yamlFile, yamlDictionaryKey string, doYaml bool, genericYaml yamler.GenericYaml, optionData []pflags.OptionData, ) (err error)
ApplyYaml updates effective options with values read from a yaml file
- program is app name “date” used to construct yaml file name
- yamlFile is a specified file, or for empty string, a scan for files:
- — filename: [program]-[hostname].yaml [program].yaml
- — Directories: ~/apps .. /etc
- — if a specified file is missing, that is error
- — if no default file exists, or file was empty, no yaml options are loaded
- yamlDictionaryKey is the key read form the top-level dictionary in yaml, empty string is default “options:”
- genericYaml is a wrapper of unknown types
- optionData is the list of options, containing pointers to effective option values
- The top entry in the yaml file must be a dictionary
- The value for yamlDictionaryKey must be a dictionary
- the remainder of the yamlDictionaryKey is read when it matches the YamData struct
- -verbose=yamlo.ApplyYaml “github.com/haraldrudell/parl/yamlo.ApplyYaml”
Types ¶
This section is empty.
Click to show internal directories.
Click to hide internal directories.