bmap

package
v1.30.9 Latest Latest
Warning

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

Go to latest
Published: Jun 24, 2021 License: MIT Imports: 4 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type BMap

type BMap map[string]interface{}

func NewBMap

func NewBMap() BMap

new BMap

func StructToBMap

func StructToBMap(v interface{}) (values BMap)

struct to BMap, maybe use Encode ps: the BMap key->value , value will be string type

func (BMap) Del

func (v BMap) Del(key string) BMap

Del deletes the values associated with key.

func (BMap) Get

func (v BMap) Get(key string) interface{}

Get gets the first value associated with the given key. If there are no values associated with the key, Get returns the empty string. To access multiple values, use the map directly.

func (BMap) Pop

func (v BMap) Pop(key string) interface{}

return Get value and Del key

func (BMap) Set

func (v BMap) Set(key string, value interface{}) BMap

Set sets the key to value. It replaces any existing values.

func (BMap) Struct

func (v BMap) Struct(value interface{}) error

BMap to struct data value like

type Te struct {
		Name string `json:"name"` // must string type
		ID   string `json:"id"` // must string type
	}

Jump to

Keyboard shortcuts

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