Documentation
¶
Index ¶
- Variables
- func IterateFimlDoc(doc *FML)
- func Unmarshal(data []byte, v interface{}) (err error)
- func UnmarshalFile(path string, v interface{}) (err error)
- func UnmarshalString(input string, v interface{}) (err error)
- type FML
- func (f *FML) GetArrayOrError(key string) (array interface{}, err error)
- func (f *FML) GetBool(key string) (val bool)
- func (f *FML) GetBoolArray(key string) []bool
- func (f *FML) GetBoolArrayOrError(key string) (arr []bool, err error)
- func (f *FML) GetBoolOrDefault(key string, defaultVal bool) bool
- func (f *FML) GetBoolOrError(key string) (val bool, err error)
- func (f *FML) GetDatetime(key string) (val time.Time)
- func (f *FML) GetDatetimeOrDefault(key string, defaultVal time.Time) time.Time
- func (f *FML) GetFloat(key string) (val float64)
- func (f *FML) GetFloatArray(key string) []float64
- func (f *FML) GetFloatArrayOrError(key string) (arr []float64, err error)
- func (f *FML) GetFloatOrDefault(key string, defaultVal float64) float64
- func (f *FML) GetFloatOrError(key string) (val float64, err error)
- func (f *FML) GetInt(key string) (val int)
- func (f *FML) GetIntArray(key string) []int
- func (f *FML) GetIntArrayOrError(key string) (arr []int, err error)
- func (f *FML) GetIntOrDefault(key string, defaultVal int) int
- func (f *FML) GetIntOrError(key string) (val int, err error)
- func (f *FML) GetNode(key string) (node *FML, err error)
- func (f *FML) GetNodeList(key string) (list []*FML, err error)
- func (f *FML) GetString(key string) (val string)
- func (f *FML) GetStringArray(key string) []string
- func (f *FML) GetStringArrayOrError(key string) (arr []string, err error)
- func (f *FML) GetStringOrDefault(key string, defaultVal string) string
- func (f *FML) GetStringOrError(key string) (val string, err error)
- func (f *FML) GetStruct(key string, v interface{}) (err error)
- func (f *FML) GetTimeArray(key string) []time.Time
- func (f *FML) GetTimeArrayOrError(key string) (arr []time.Time, err error)
- func (f *FML) GetTimeOrError(key string) (val time.Time, err error)
- func (f *FML) KeySet() (keys []string)
- func (f *FML) RemoveItem(key string)
- func (f *FML) SetValue(key string, v interface{})
- func (f *FML) ValueSet() (values []interface{})
- func (f *FML) WriteTo(writer *bufio.Writer)
- func (f *FML) WriteToFile(path string) (err error)
Constants ¶
This section is empty.
Variables ¶
var (
Delimiter byte = '='
)
Functions ¶
func UnmarshalFile ¶
func UnmarshalString ¶
Types ¶
type FML ¶
type FML struct {
// contains filtered or unexported fields
}
A FML represents a fml node
func ParseString ¶
func (*FML) GetArrayOrError ¶
GetArrayOrError gets an array from the node.
func (*FML) GetBool ¶
GetBoolOrZero gets a bool value from the node, or return zero value of bool, false, if the key does not exist or other error happens.
func (*FML) GetBoolArray ¶
GetBoolArray gets an array of bool from the node. It returns nil if the key does not exist or other error happens.
func (*FML) GetBoolArrayOrError ¶
GetBoolArrayOrError gets an array of bool from the node.
func (*FML) GetBoolOrDefault ¶
GetBoolOrDefault gets a bool value from the node, or return defaultVal, if the key does not exist or other error happens.
func (*FML) GetBoolOrError ¶
GetBoolOrError gets a bool value from the node.
func (*FML) GetDatetime ¶
GetDatetime gets a time.Time value from the node, or return zero value of Datetime, time.Time{}, if the key does not exist or other error happens.
func (*FML) GetDatetimeOrDefault ¶
GetDatetimeOrDefault gets a time.Time value from the node, or return defaultVal, if the key does not exist or other error happens.
func (*FML) GetFloat ¶
GetFloat gets a float value from the node, or return zero value of int, 0, if the key does not exist or other error happens.
func (*FML) GetFloatArray ¶
GetFloatArray gets an array of float from the node. It returns nil if the key does not exist or other error happens.
func (*FML) GetFloatArrayOrError ¶
GetFloatArrayOrError gets an array of float from the node.
func (*FML) GetFloatOrDefault ¶
GetFloatOrDefault gets a float value from the node, or return defaultVal, if the key does not exist or other error happens.
func (*FML) GetFloatOrError ¶
GetFloatOrError gets a float value from the node.
func (*FML) GetInt ¶
GetIntOrZero gets a int value from the node, or return zero value of int, 0, if the key does not exist or other error happens.
func (*FML) GetIntArray ¶
GetIntArray gets an array of int from the node. It returns nil if the key does not exist or other error happens.
func (*FML) GetIntArrayOrError ¶
GetIntArrayOrError gets an array of int from the node.
func (*FML) GetIntOrDefault ¶
GetIntOrDefault gets a int value from the node, or return defaultVal, if the key does not exist or other error happens.
func (*FML) GetIntOrError ¶
GetIntOrError gets a int value from the node.
func (*FML) GetNodeList ¶
GetNodeList gets a node list from the node
func (*FML) GetString ¶
GetString gets a string value from the node, or return zero value of string, "", if the key does not exist or other error happens.
func (*FML) GetStringArray ¶
GetStringArray gets an array of string from the node. It returns nil if the key does not exist or other error happens.
func (*FML) GetStringArrayOrError ¶
GetStringArrayOrError gets an array of string from the node.
func (*FML) GetStringOrDefault ¶
GetStringOrDefault gets a string value from the node, or return defaultVal if the key does not exist or other error happens.
func (*FML) GetStringOrError ¶
GetStringOrError gets a string value from the node.
func (*FML) GetTimeArray ¶
GetDatetimeArray gets an array of time.Time from the node. It returns nil if the key does not exist or other error happens.
func (*FML) GetTimeArrayOrError ¶
GetDatetimeArray gets an array of time.Time from the node.
func (*FML) GetTimeOrError ¶
GetTimeOrError gets a time.Time value from the node.