cmap

package
v1.10.2 Latest Latest
Warning

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

Go to latest
Published: Sep 1, 2020 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 CMap

type CMap map[string][]string

func NewCMap added in v1.9.4

func NewCMap() CMap

new cmap

func (CMap) Add

func (v CMap) Add(key, value string) CMap

Add adds the value to key. It appends to any existing values associated with key.

func (CMap) BSON added in v1.10.0

func (v CMap) BSON() (bm bson.M)

url.Values to mongo bson CMap

func (CMap) CMap

func (v CMap) CMap(values url.Values) CMap

url.Values to CMap Deprecated

func (CMap) Del

func (v CMap) Del(key string) CMap

Del deletes the values associated with key.

func (CMap) Get

func (v CMap) Get(key string) string

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 (CMap) Pop added in v1.9.4

func (v CMap) Pop(key string) string

return Get value and Del key

func (CMap) Set

func (v CMap) Set(key, value string) CMap

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

func (CMap) Struct

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

CMap 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