bconf

package module
v0.0.0-...-7d09075 Latest Latest
Warning

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

Go to latest
Published: Apr 25, 2014 License: ISC Imports: 12 Imported by: 0

README

Bconf

If you don't know what it's for, don't worry about it.

Documentation

Overview

Copyright 2013 Artur Grabowski. All rights reserved. Use of this source code is governed by a ISC-style license that can be found in the LICENSE file.

Copyright 2014 Thordur Bjornsson. All rights reserved. Use of this source code is governed by a ISC-style license that can be found in the LICENSE file.

Copyright 2013 Artur Grabowski. All rights reserved. Use of this source code is governed by a ISC-style license that can be found in the LICENSE file.

Copyright 2013 Artur Grabowski. All rights reserved. Use of this source code is governed by a ISC-style license that can be found in the LICENSE file.

Copyright 2013 Artur Grabowski. All rights reserved. Use of this source code is governed by a ISC-style license that can be found in the LICENSE file.

Copyright 2013 Artur Grabowski. All rights reserved. Use of this source code is governed by a ISC-style license that can be found in the LICENSE file.

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type Bconf

type Bconf map[string]interface{}

func (Bconf) AddValue

func (bc Bconf) AddValue(k []string, v string)

Add a value to the Bconf.

func (Bconf) ForeachNode

func (bc Bconf) ForeachNode(f func(name string, bc Bconf))

Call the callback function for every node under a Bconf node. The nodes are unsorted. When the walk has to be sorted, use ForeachSortedNode instead which is slower.

func (Bconf) ForeachSortedNode

func (bc Bconf) ForeachSortedNode(f func(name string, bc Bconf))

Call the callback function for every node under a Bconf node. The nodes are sorted on their name. When the walk doesn't need to be sorted, used ForeachNode instead which is faster.

func (Bconf) ForeachSortedVal

func (bc Bconf) ForeachSortedVal(f func(k, v string))

Call the callback function for every value (not node) in a Bconf node. The values are sorted on their key. When the walk doesn't need to be sorted, use ForeachVal instead which is faster.

func (Bconf) ForeachVal

func (bc Bconf) ForeachVal(f func(k, v string))

Call the callback function for every value (not node) in a Bconf node. The values are unsorted. When the walk has to be sorted, use ForeachSortedVal instead which is slower.

func (Bconf) GetNode

func (bc Bconf) GetNode(k ...string) Bconf

Get a bconf node under a varargs key

func (Bconf) GetString

func (bc Bconf) GetString(k ...string) string

Return a string from bconf under a key, returns empty string if key not found.

func (*Bconf) LoadConfData

func (bc *Bconf) LoadConfData(f io.Reader) error

Populate a Bconf with data from the bconf-formatted io.Reader.

func (*Bconf) LoadConfFile

func (bc *Bconf) LoadConfFile(fname string) error

Populate a Bconf with data from the bconf-formatted file provided here as a name.

func (*Bconf) LoadHTTP

func (bc *Bconf) LoadHTTP(bconfurl, host, appl string) error

func (*Bconf) LoadJSONReader

func (bc *Bconf) LoadJSONReader(r io.Reader) error

func (*Bconf) LoadJson

func (bc *Bconf) LoadJson(js []byte) error

Populate a Bconf with data from a byte array that contains json. Returns json parsing errors.

func (Bconf) Merge

func (dst Bconf) Merge(src Bconf)

Merge 'src' into 'dst' overwriting values and branches in 'dst'.

func (Bconf) Unmarshal

func (bc Bconf) Unmarshal(v interface{}) (err error)

Unmarshal the node, which must be a leaf node into v. If v is not a struct pointer, Unmarshal will panic.

Jump to

Keyboard shortcuts

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