hashmap

package
v1.0.5 Latest Latest
Warning

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

Go to latest
Published: Sep 5, 2022 License: Apache-2.0 Imports: 15 Imported by: 3

Documentation

Overview

Package hashmap

@author: xwc1125

Package hashmap

@author: xwc1125

Package hashmap

@author: xwc1125

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func Get

func Get(v interface{}, path ...interface{}) (interface{}, error)

func GetMapI

func GetMapI(v interface{}, path ...interface{}) (map[interface{}]interface{}, error)

func GetMapS

func GetMapS(v interface{}, path ...interface{}) (map[string]interface{}, error)

GetMapS returns a map with string keys denoted by the path.

If path is empty or nil, v is returned as a slice.

func StringToByteSizesHookFunc

func StringToByteSizesHookFunc(
	f reflect.Type,
	des reflect.Type,
	data interface{}) (interface{}, error)

Types

type HashMap

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

HashMap ...

func NewHashMap

func NewHashMap(isSafe bool) *HashMap

NewHashMap ...

func NewHashMapFill

func NewHashMapFill(val interface{}) *HashMap

func NewHashMapSame

func NewHashMapSame(isSafe bool, val interface{}) *HashMap

func (*HashMap) Decode

func (m *HashMap) Decode(data []byte) error

func (*HashMap) DecodeRLP

func (m *HashMap) DecodeRLP(s *rlp.Stream) error

func (*HashMap) EncodeRLP

func (m *HashMap) EncodeRLP(w io.Writer) error

func (*HashMap) Exist

func (m *HashMap) Exist(k string) bool

Exist ...

func (*HashMap) ForEach

func (m *HashMap) ForEach() map[string]interface{}

ForEach 复制map用于外部遍历

func (*HashMap) Get

func (m *HashMap) Get(k string) (obj interface{}, objType string, isExist bool)

Get ... @obj: 值对象 @objType: 值类型 @isExist: 是否存在

func (*HashMap) GetObj

func (m *HashMap) GetObj(k string) (obj interface{})

GetObj ...

func (*HashMap) GetValue

func (m *HashMap) GetValue(k string) reflect.Value

GetValue ...

func (*HashMap) GetValues

func (m *HashMap) GetValues(k string) []reflect.Value

GetValues ...

func (*HashMap) HasKey

func (m *HashMap) HasKey(k string) (bool, string)

HasKey 判断是否包括key,如果包含key返回value的类型

func (*HashMap) MarshalJSON

func (m *HashMap) MarshalJSON() ([]byte, error)

func (*HashMap) Put

func (m *HashMap) Put(k string, v interface{})

Put 增加或者修改一个元素

func (*HashMap) Remove

func (m *HashMap) Remove(k string) (interface{}, bool)

Remove 移除一个元素

func (*HashMap) SetSafe

func (m *HashMap) SetSafe(isSafe bool)

SetSafe 设置为是否安全

func (*HashMap) Size

func (m *HashMap) Size() int

Size ...

func (*HashMap) Sort

func (m *HashMap) Sort() []KV

Sort 排序

func (*HashMap) String

func (m *HashMap) String() string

String ...

func (*HashMap) ToStruct

func (m *HashMap) ToStruct(out interface{}) error

ToStruct 用map填充结构

func (*HashMap) UnmarshalJSON

func (m *HashMap) UnmarshalJSON(bytes []byte) error

type KV

type KV struct {
	Key   string
	Value interface{}
}

KV ...

Jump to

Keyboard shortcuts

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