A golang package for reading config file
import "github.com/minph/conf"
type Reader
type Reader struct {
// Value data
Value map[string]string
// Path the config file path
Path string
// Delimiter the delimiter between groupname and keyname
// default as ":"
Delimiter string
// Group the groupName list
Group []string
}
Reader info struct of config file
func New
func New(path string) *Reader
New to create a Reader
will do UpdateContent() automatically
func (*Reader) Get
func (r *Reader) Get(groupName, itemName string) (value string, key string, err error)
Get value by using groupname and keyname
func (*Reader) GetItems
func (r *Reader) GetItems(itemName string) []string
GetItems will return all suited itemnames from all groupnames
func (*Reader) GetValue
func (r *Reader) GetValue(groupName, itemName string) string
GetValue Get value by using GroupName & KeyName
Force return a value which is "" default
func (*Reader) UpdateContent
func (r *Reader) UpdateContent()
UpdateContent update data from path will provide path data for conf.Reader