jsonordered

package
v0.0.0-...-dbf91d7 Latest Latest
Warning

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

Go to latest
Published: Apr 9, 2021 License: MIT Imports: 4 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func UnmarshalToOrderJson

func UnmarshalToOrderJson(bs []byte) (interface{}, error)

解析json字符串为 []MapSlice or MapSlice, 分别对应数组和对象.

Types

type MapItem

type MapItem struct {
	Key string
	Val interface{}
}

MapItem is an item in a MapSlice.

type MapSlice

type MapSlice []MapItem

MapSlice encodes and decodes as a JSON map. The order of keys is preserved when encoding and decoding. Just like yaml.MapSlice

func (MapSlice) Get

func (j MapSlice) Get(key string) (v interface{}, exist bool)

func (MapSlice) MarshalJSON

func (j MapSlice) MarshalJSON() ([]byte, error)

func (*MapSlice) UnmarshalJSON

func (j *MapSlice) UnmarshalJSON(bytes []byte) error

Jump to

Keyboard shortcuts

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