orderedjson

package
v0.0.8 Latest Latest
Warning

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

Go to latest
Published: Jul 12, 2019 License: GPL-3.0 Imports: 4 Imported by: 0

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 OJsonBool

type OJsonBool bool

OJsonBool ... JSON bool value

type OJsonKeyValuePair

type OJsonKeyValuePair struct {
	Key   string
	Value OJsonObject
}

OJsonKeyValuePair ... since this ir ordered JSON, maps are really ordered lists of key value pairs, this class

type OJsonList

type OJsonList []OJsonObject

OJsonList ... JSON list

func (*OJsonList) AsList

func (j *OJsonList) AsList() []OJsonObject

AsList ... returns it represented as a slice of objects

type OJsonMap

type OJsonMap struct {
	KeySet    map[string]bool
	OrderedKV []*OJsonKeyValuePair
}

OJsonMap ... ordered map, actually a list of key value pairs

func NewMap

func NewMap() *OJsonMap

NewMap ... create new ordered "map" instance

func (*OJsonMap) Put

func (j *OJsonMap) Put(key string, value OJsonObject)

Put ... put into map. Nothing if key exists in map

func (*OJsonMap) RefreshKeySet

func (j *OJsonMap) RefreshKeySet()

RefreshKeySet ... recreate the key set from the key value pairs

func (*OJsonMap) Size

func (j *OJsonMap) Size() int

Size ... size of ordered map

type OJsonObject

type OJsonObject interface {
	// contains filtered or unexported methods
}

OJsonObject ... ordered JSON tree object interface

func ParseOrderedJSON

func ParseOrderedJSON(input []byte) (OJsonObject, error)

ParseOrderedJSON ... parses JSON preserving order in maps

type OJsonString

type OJsonString struct {
	Value string
}

OJsonString ... JSON string value

Jump to

Keyboard shortcuts

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