Documentation
¶
Overview ¶
Package config is used to initialize the configuration.
Index ¶
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
func ConvertOptsToCliFlags ¶
func ConvertOptsToCliFlags(groups ...string) []cli.Flag
ConvertOptsToCliFlags the config group to []cli.Flag. For example,
ConvertOptsToCliFlags() // Convert the options in the DEFAULT group ConvertOptsToCliFlags("group1") // Convert the options in the group named "group1" ConvertOptsToCliFlags("group1.group2") // Convert the options in the group named "group1.group2" ConvertOptsToCliFlags("group1", "group2") // The same as the last.
func GetAllConfigs ¶ added in v0.16.0
GetAllConfigs returns all the registered configuration options.
If conf is equal to nil, it uses gconf.Conf as the default.
func InitConfig ¶
InitConfig initliazlies the configuration options.
options may be gconf.Opt, []gconf.Opt, a pointer to the struct variable, or the list of the pointers to the struct variables. For example,
InitConfig("", gconf.StrOpt("optname", "HELP TEXT")) InitConfig("appname", []gconf.Opt{gconf.StrOpt("optname", "HELP TEXT")}) InitConfig("", []interface{}{structPtr1, structPtr2}, "1.0.0") InitConfig("", structPtr, "1.0.0")
func LoadCliSource ¶
func LoadCliSource(ctx *cli.Context, groups ...string)
LoadCliSource loads the config into the groups from the CLI source.
Types ¶
Click to show internal directories.
Click to hide internal directories.