goini

package module
v0.0.0-...-59bd237 Latest Latest
Warning

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

Go to latest
Published: Jun 1, 2014 License: MIT Imports: 6 Imported by: 0

README

goini

INI (php zend like) config parser for Go lang

Gopkg v1 import: http://gopkg.in/jurka/goini.v1

Build Status

Documentation

Index

Constants

View Source
const (
	COMMENT   = ';'
	SEPARATOR = '='

	ERR_KEY_NOT_EXISTS = "Key not exist"
)

Variables

This section is empty.

Functions

This section is empty.

Types

type Config

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

Config is the representation of configuration settings.

func LoadConfig

func LoadConfig(fname string) (*Config, error)

func (*Config) GetSection

func (cfg *Config) GetSection(s string) *OptionsMap

func (*Config) GetSectionList

func (cfg *Config) GetSectionList() []string

type OptionsMap

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

func (*OptionsMap) Bool

func (o *OptionsMap) Bool(k string) (bool, error)

synonym for GetBool

func (*OptionsMap) Float64

func (o *OptionsMap) Float64(k string) (float64, error)

synonym for GetFloat

func (*OptionsMap) GetBool

func (o *OptionsMap) GetBool(k string) (bool, error)

Get value as a bool, uses this mapping from string to bool "t": true, "true": true, "y": true, "yes": true, "on": true, "1": true, "f": false, "false": false, "n": false, "no": false, "off": false, "0": false,

func (*OptionsMap) GetFloat

func (o *OptionsMap) GetFloat(k string) (float64, error)

Get value as float64

func (*OptionsMap) GetInt

func (o *OptionsMap) GetInt(k string) (int, error)

Get value as int

func (*OptionsMap) GetString

func (o *OptionsMap) GetString(k string) (string, error)

Get value as a string, remove quotes if value was quoted into " or '

func (*OptionsMap) Int

func (o *OptionsMap) Int(k string) (int, error)

synonym for GetInt

func (*OptionsMap) Len

func (o *OptionsMap) Len() int

func (*OptionsMap) String

func (o *OptionsMap) String(k string) (string, error)

synonym for GetString

Jump to

Keyboard shortcuts

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