Documentation ¶
Index ¶
- type JSONData
- func (jo *JSONData) Get(path string) (*JSONNode, error)
- func (jo *JSONData) GetBool(path string) (bool, error)
- func (jo *JSONData) GetFloat(path string) (float64, error)
- func (jo *JSONData) GetInt(path string) (int, error)
- func (jo *JSONData) GetRootNode() (*JSONNode, error)
- func (jo *JSONData) GetString(path string) (string, error)
- func (jo *JSONData) IsArray(path string) (bool, error)
- func (jo *JSONData) IsBool(path string) (bool, error)
- func (jo *JSONData) IsFloat(path string) (bool, error)
- func (jo *JSONData) IsInt(path string) (bool, error)
- func (jo *JSONData) IsMap(path string) (bool, error)
- func (jo *JSONData) IsString(path string) (bool, error)
- func (jo *JSONData) IsValidPath(path string) (bool, error)
- func (jo *JSONData) SetBool(path string, value bool) error
- func (jo *JSONData) SetFloat(path string, value float64) error
- func (jo *JSONData) SetInt(path string, value int) error
- func (jo *JSONData) SetString(path, value string) error
- type JSONNode
- func (n *JSONNode) Get(key string) (*JSONNode, error)
- func (n *JSONNode) GetBool() (bool, error)
- func (n *JSONNode) GetFloat() (float64, error)
- func (n *JSONNode) GetInt() (int, error)
- func (n *JSONNode) GetNodeAt(index int) (*JSONNode, error)
- func (n *JSONNode) GetString() (string, error)
- func (n *JSONNode) HaveKey(key string) (bool, error)
- func (n *JSONNode) IsArray() bool
- func (n *JSONNode) IsBool() bool
- func (n *JSONNode) IsFloat() bool
- func (n *JSONNode) IsInt() bool
- func (n *JSONNode) IsMap() bool
- func (n *JSONNode) IsString() bool
- func (n *JSONNode) Len() int
- func (n *JSONNode) Set(key string, node *JSONNode) error
- func (n *JSONNode) SetBool(val bool) error
- func (n *JSONNode) SetFloat(val float64) error
- func (n *JSONNode) SetInt(val int) error
- func (n *JSONNode) SetString(val string) error
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
This section is empty.
Types ¶
type JSONData ¶
type JSONData struct {
// contains filtered or unexported fields
}
JSONData represent a whole Json construct.
func NewJSONData ¶
NewJSONData will create a new instance of JSONData
func (*JSONData) GetBool ¶
GetBool will get the bool value from a json indicated by specified path. Error returned if path is not valid.
func (*JSONData) GetFloat ¶
GetFloat will get the float value from a json indicated by specified path. Error returned if path is not valid.
func (*JSONData) GetInt ¶
GetInt will get the int value from a json indicated by specified path. Error returned if path is not valid.
func (*JSONData) GetRootNode ¶
GetRootNode will return the root node of this JSONData
func (*JSONData) GetString ¶
GetString will get the string value from a json indicated by specified path. Error returned if path is not valid.
func (*JSONData) IsArray ¶
IsArray will check if the node indicated by specified path is an Array node
func (*JSONData) IsFloat ¶
IsFloat will check if the node indicated by specified path is a float node
func (*JSONData) IsString ¶
IsString will check if the node indicated by specified path is a string node
func (*JSONData) IsValidPath ¶
IsValidPath will check if the provided path is valid
type JSONNode ¶
type JSONNode struct {
// contains filtered or unexported fields
}
JSONNode represent a node in JSON Tree