Help us shape the future of Go! Take the 2026 Go Developer Survey

ucfg

package module
v0.0.0 Latest Latest
Warning

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

Go to latest
Published: Feb 29, 2016 License: Apache-2.0 Imports: 5 Imported by: 796

README

ucfg

Build Status

Documentation

Index

Constants

This section is empty.

Variables

View Source
var (
	ErrMissing = errors.New("field name missing")

	ErrTypeNoArray = errors.New("field is no array")

	ErrTypeMismatch = errors.New("type mismatch")

	ErrKeyTypeNotString = errors.New("key must be a string")

	ErrIndexOutOfRange = errors.New("index out of range")

	ErrPointerRequired = errors.New("requires pointer for unpacking")

	ErrArraySizeMistach = errors.New("Array size mismatch")

	ErrExpectedObject = errors.New("expected object")

	ErrNilConfig = errors.New("config is nil")

	ErrNilValue = errors.New("unexpected nil value")

	ErrTODO = errors.New("TODO - implement me")
)

Functions

This section is empty.

Types

type Config

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

func New

func New() *Config

func NewFrom

func NewFrom(from interface{}, opts ...Option) (*Config, error)

func (*Config) Bool

func (c *Config) Bool(name string, idx int) (bool, error)

func (*Config) Child

func (c *Config) Child(name string, idx int) (*Config, error)

func (*Config) CountField

func (c *Config) CountField(name string) (int, error)

number of elements for this field. If config value is a list, returns number of elements in list

func (*Config) Float

func (c *Config) Float(name string, idx int) (float64, error)

func (*Config) GetFields

func (c *Config) GetFields() []string

func (*Config) HasField

func (c *Config) HasField(name string) bool

func (*Config) Int

func (c *Config) Int(name string, idx int) (int64, error)

func (*Config) Merge

func (c *Config) Merge(from interface{}, options ...Option) error

func (*Config) SetBool

func (c *Config) SetBool(name string, idx int, value bool)

func (*Config) SetChild

func (c *Config) SetChild(name string, idx int, value *Config)

func (*Config) SetFloat

func (c *Config) SetFloat(name string, idx int, value float64)

func (*Config) SetInt

func (c *Config) SetInt(name string, idx int, value int64)

func (*Config) SetString

func (c *Config) SetString(name string, idx int, value string)

func (*Config) String

func (c *Config) String(name string, idx int) (string, error)

func (*Config) Unpack

func (c *Config) Unpack(to interface{}, options ...Option) error

type Option

type Option func(*options)

func PathSep

func PathSep(sep string) Option

func StructTag

func StructTag(tag string) Option

Directories

Path Synopsis

Jump to

Keyboard shortcuts

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