cmap

package
v1.0.0 Latest Latest
Warning

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

Go to latest
Published: Mar 14, 2021 License: Apache-2.0 Imports: 7 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

type Map map[string]interface{}

func New

func New() CMap

new a CMap

func Struct

func Struct(v interface{}) (values CMap)

new a CMap from struct

func Values

func Values(values url.Values) CMap

new a CMap from url.Values

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) Append

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

Append set the key to value if it doesn't exists. append if it exists.

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) Obtain

func (v CMap) Obtain(key string) []string

Obtain get all values associated with the given key.

func (CMap) Pop

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) ToMap

func (v CMap) ToMap() map[string]interface{}

func (CMap) ToStruct

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

CMap to struct or map[string]string or map[string]interface{} data

func (CMap) ToValues

func (v CMap) ToValues() url.Values

Jump to

Keyboard shortcuts

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