Documentation ¶
Index ¶
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
func JSONString ¶
func JSONString(j OJsonObject) string
JSONString returns a formatted string representation of an ordered JSON
Types ¶
type OJsonKeyValuePair ¶
type OJsonKeyValuePair struct { Key string Value OJsonObject }
OJsonKeyValuePair is a key-value pair in a JSON map. Since this is ordered JSON, maps are really ordered lists of key value pairs.
type OJsonList ¶
type OJsonList []OJsonObject
OJsonList is a JSON list.
func (*OJsonList) AsList ¶
func (j *OJsonList) AsList() []OJsonObject
AsList converts a JSON list to a slice of objects.
type OJsonMap ¶
type OJsonMap struct { KeySet map[string]bool OrderedKV []*OJsonKeyValuePair }
OJsonMap is an ordered map, actually a list of key value pairs.
func (*OJsonMap) KeyValuePairsSortedByKey ¶
func (j *OJsonMap) KeyValuePairsSortedByKey() []*OJsonKeyValuePair
KeyValuePairsSortedByKey returns the list of key-value pairs sorted by key.
func (*OJsonMap) Put ¶
func (j *OJsonMap) Put(key string, value OJsonObject)
Put puts into map. Does nothing if key exists in map.
func (*OJsonMap) RefreshKeySet ¶
func (j *OJsonMap) RefreshKeySet()
RefreshKeySet recreates the key set from the key value pairs.
type OJsonObject ¶
type OJsonObject interface {
// contains filtered or unexported methods
}
OJsonObject is an ordered JSON tree object interface.
func ParseOrderedJSON ¶
func ParseOrderedJSON(input []byte) (OJsonObject, error)
ParseOrderedJSON parses JSON preserving order in maps
Click to show internal directories.
Click to hide internal directories.