Config

type MergedConfig

type MergedConfig struct {
    // contains filtered or unexported fields
}

This handles the parsing of app.conf It has a "preferred" section that is checked first for option queries. If the preferred section does not have the option, the DEFAULT section is checked fallback.

func LoadConfig

func LoadConfig(confName string) (*MergedConfig, error)

func (*MergedConfig) Bool

func (c *MergedConfig) Bool(option string) (result, found bool)

func (*MergedConfig) BoolDefault

func (c *MergedConfig) BoolDefault(option string, dfault bool) bool

func (*MergedConfig) HasSection

func (c *MergedConfig) HasSection(section string) bool

func (*MergedConfig) Int

func (c *MergedConfig) Int(option string) (result int, found bool)

func (*MergedConfig) IntDefault

func (c *MergedConfig) IntDefault(option string, dfault int) int

func (*MergedConfig) Options

func (c *MergedConfig) Options(prefix string) []string

Options returns all configuration option keys. If a prefix is provided, then that is applied as a filter.

func (*MergedConfig) Raw

func (c *MergedConfig) Raw() *config.Config

func (*MergedConfig) SetOption

func (c *MergedConfig) SetOption(name, value string)

func (*MergedConfig) SetSection

func (c *MergedConfig) SetSection(section string)

func (*MergedConfig) String

func (c *MergedConfig) String(option string) (result string, found bool)

func (*MergedConfig) StringDefault

func (c *MergedConfig) StringDefault(option, dfault string) string