maps

package
v0.0.0-...-7647e70 Latest Latest
Warning

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

Go to latest
Published: May 8, 2024 License: MIT Imports: 4 Imported by: 173

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type Map

type Map map[string]interface{}

func DecodeJSON

func DecodeJSON(jsonData []byte) (Map, error)

DecodeJSON 从字节数据中解码map

func NewMap

func NewMap(maps ...interface{}) Map

NewMap 新建Map

func (Map) AsJSON

func (this Map) AsJSON() []byte

AsJSON 转换为JSON

func (Map) AsPrettyJSON

func (this Map) AsPrettyJSON() []byte

AsPrettyJSON 转换为格式化后的JSON

func (Map) Delete

func (this Map) Delete(key ...string)

Delete 删除键

func (Map) Get

func (this Map) Get(key string) interface{}

Get 取得键值

func (Map) GetBool

func (this Map) GetBool(key string) bool

GetBool 取得bool类型的键值

func (Map) GetBytes

func (this Map) GetBytes(key string) []byte

GetBytes 取得Byte Slice键值

func (Map) GetFloat32

func (this Map) GetFloat32(key string) float32

GetFloat32 取得float32类型的键值

func (Map) GetFloat64

func (this Map) GetFloat64(key string) float64

GetFloat64 取得float64类型的键值

func (Map) GetInt

func (this Map) GetInt(key string) int

GetInt 取得int类型的键值

func (Map) GetInt16

func (this Map) GetInt16(key string) int16

GetInt16 取得int16类型的键值

func (Map) GetInt32

func (this Map) GetInt32(key string) int32

GetInt32 取得int32类型的键值

func (Map) GetInt64

func (this Map) GetInt64(key string) int64

GetInt64 取得int64类型的键值

func (Map) GetInt8

func (this Map) GetInt8(key string) int8

GetInt8 取得int8类型的键值

func (Map) GetMap

func (this Map) GetMap(key string) Map

GetMap 取得Map类型的键值

func (Map) GetSlice

func (this Map) GetSlice(key string) []interface{}

GetSlice 取得Slice类型的键值

func (Map) GetString

func (this Map) GetString(key string) string

GetString 取得字符串类型的键值

func (Map) GetUint

func (this Map) GetUint(key string) uint

GetUint 取得uint类型的键值

func (Map) GetUint16

func (this Map) GetUint16(key string) uint16

GetUint16 取得uint16类型的键值

func (Map) GetUint32

func (this Map) GetUint32(key string) uint32

GetUint32 取得uint32类型的键值

func (Map) GetUint64

func (this Map) GetUint64(key string) uint64

GetUint64 取得uint64类型的键值

func (Map) GetUint8

func (this Map) GetUint8(key string) uint8

GetUint8 取得uint8类型的键值

func (Map) GoMap

func (this Map) GoMap() map[string]interface{}

GoMap 转换为map[string]interface{}

func (Map) Has

func (this Map) Has(key string) bool

Has 判断是否有某个键值

func (Map) Increase

func (this Map) Increase(key string, delta interface{}) interface{}

Increase 给某个键值增加数值(可以为负),并返回操作后的值

func (Map) Keys

func (this Map) Keys() []interface{}

Keys 取得所有键

func (Map) Len

func (this Map) Len() int

Len 取得键值数量

func (Map) Put

func (this Map) Put(key string, value interface{})

Put 添加键值

func (Map) Values

func (this Map) Values() []interface{}

Values 取得所有值

type OrderedMap

type OrderedMap struct {
	// contains filtered or unexported fields
}

func NewOrderedMap

func NewOrderedMap() *OrderedMap

func (*OrderedMap) Delete

func (this *OrderedMap) Delete(key interface{})

Delete 删除元素

func (*OrderedMap) Get

func (this *OrderedMap) Get(key interface{}) (value interface{}, ok bool)

Get 取得元素值

func (*OrderedMap) Keys

func (this *OrderedMap) Keys() []interface{}

Keys 取得所有Key

func (*OrderedMap) Len

func (this *OrderedMap) Len() int

Len 取得Map的长度

func (*OrderedMap) Put

func (this *OrderedMap) Put(key interface{}, value interface{})

Put 添加元素

func (*OrderedMap) Range

func (this *OrderedMap) Range(iterator func(key interface{}, value interface{}))

Range 对每个元素执行迭代器

func (*OrderedMap) Reverse

func (this *OrderedMap) Reverse()

Reverse 翻转键

func (*OrderedMap) Sort

func (this *OrderedMap) Sort()

Sort 根据元素值进行排序

func (*OrderedMap) SortKeys

func (this *OrderedMap) SortKeys()

SortKeys 根据Key进行排序

Jump to

Keyboard shortcuts

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