dict

package
v0.2.1 Latest Latest
Warning

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

Go to latest
Published: Sep 23, 2022 License: MIT Imports: 5 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type Dict

type Dict map[string]interface{}

对 map 字段 进行 url 参数拼接

  • 参考 标准库 "net/url" 的 url.Values 实现

TODO:

针对 encode() 特别说明:
	1. 对于 嵌套 struct 的数据类型, 会在首层迭代时, 转换成 json string, 再 encode()
	2. 这里对 interface{} 数据类型的断言, 是不完善的, 暂时不处理

func (Dict) Del

func (m Dict) Del(key string)

Del deletes the values associated with key.

func (Dict) Encode

func (m Dict) Encode() string

Encode encodes the values into “URL encoded” form ("bar=baz&foo=quux") sorted by key.

func (Dict) Get

func (m Dict) Get(key string) interface{}

func (Dict) Set

func (m Dict) Set(key string, value interface{})

type StringDict

type StringDict map[string]string

对 map 字段 进行 url 参数拼接

  • 参考 标准库 "net/url" 的 url.Values 实现

func (StringDict) Del

func (m StringDict) Del(key string)

Del deletes the values associated with key.

func (StringDict) Encode

func (m StringDict) Encode() string

Encode encodes the values into “URL encoded” form ("bar=baz&foo=quux") sorted by key.

func (StringDict) Get

func (m StringDict) Get(key string) string

func (StringDict) Set

func (m StringDict) Set(key string, value string)

Jump to

Keyboard shortcuts

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