conf

package
v0.0.0-...-69ab156 Latest Latest
Warning

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

Go to latest
Published: Oct 10, 2019 License: BSD-3-Clause Imports: 9 Imported by: 0

Documentation

Overview

Package conf implements parse the taf config.

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type Conf

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

Conf struct for parse xml-like tars config file.

func New

func New() *Conf

New news new Conf struct.

func NewConf

func NewConf(fileName string) (*Conf, error)

NewConf new conf struct with the fileName.

func (*Conf) GetDomain

func (c *Conf) GetDomain(path string) []string

GetDomain gets domain from the given path.

func (*Conf) GetInt

func (c *Conf) GetInt(path string) int

GetInt gets int from the given path.

func (*Conf) GetIntWithDef

func (c *Conf) GetIntWithDef(path string, defVal int) int

GetIntWithDef gets int from the given path with the default value.

func (*Conf) GetMap

func (c *Conf) GetMap(path string) map[string]string

GetMap gets map[string]string from the given path.

func (*Conf) GetString

func (c *Conf) GetString(path string) string

GetString getString with the given path.

func (*Conf) GetStringWithDef

func (c *Conf) GetStringWithDef(path string, defVal string) string

GetStringWithDef gets string from the given path with the default value.

func (*Conf) InitFromBytes

func (c *Conf) InitFromBytes(content []byte) error

InitFromBytes inits the Conf with the []byte.

func (*Conf) InitFromFile

func (c *Conf) InitFromFile(fileName string) error

InitFromFile init the conf with the file.

func (*Conf) InitFromString

func (c *Conf) InitFromString(content string) error

InitFromString inits Conf from string.

func (*Conf) ToString

func (c *Conf) ToString() string

ToString returns string of the Conf.

Jump to

Keyboard shortcuts

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