config

package
v1.3.0 Latest Latest
Warning

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

Go to latest
Published: Jun 19, 2014 License: Apache-2.0 Imports: 10 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func ReadYmlReader

func ReadYmlReader(path string) (cnf map[string]interface{}, err error)

Read yaml file to map. if json like, use json package, unless goyaml2 package.

Types

type YAMLConfig

type YAMLConfig struct {
}

YAMLConfig is a yaml config parser and implements Config interface.

func (*YAMLConfig) Parse

func (yaml *YAMLConfig) Parse(filename string) (config.ConfigContainer, error)

Parse returns a ConfigContainer with parsed yaml config map.

type YAMLConfigContainer

type YAMLConfigContainer struct {
	sync.Mutex
	// contains filtered or unexported fields
}

A Config represents the yaml configuration.

func (*YAMLConfigContainer) Bool

func (c *YAMLConfigContainer) Bool(key string) (bool, error)

Bool returns the boolean value for a given key.

func (*YAMLConfigContainer) DIY

func (c *YAMLConfigContainer) DIY(key string) (v interface{}, err error)

DIY returns the raw value by a given key.

func (*YAMLConfigContainer) Float

func (c *YAMLConfigContainer) Float(key string) (float64, error)

Float returns the float value for a given key.

func (*YAMLConfigContainer) Int

func (c *YAMLConfigContainer) Int(key string) (int, error)

Int returns the integer value for a given key.

func (*YAMLConfigContainer) Int64

func (c *YAMLConfigContainer) Int64(key string) (int64, error)

Int64 returns the int64 value for a given key.

func (*YAMLConfigContainer) Set

func (c *YAMLConfigContainer) Set(key, val string) error

WriteValue writes a new value for key.

func (*YAMLConfigContainer) String

func (c *YAMLConfigContainer) String(key string) string

String returns the string value for a given key.

func (*YAMLConfigContainer) Strings

func (c *YAMLConfigContainer) Strings(key string) []string

Strings returns the []string value for a given key.

Jump to

Keyboard shortcuts

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