bm

package module
v0.0.5 Latest Latest
Warning

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

Go to latest
Published: Oct 23, 2024 License: Apache-2.0 Imports: 7 Imported by: 3

README

bm

body map

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type BodyMap

type BodyMap map[string]any

func (BodyMap) CheckEmptyError

func (bm BodyMap) CheckEmptyError(keys ...string) error

func (BodyMap) Decode added in v0.0.5

func (bm BodyMap) Decode(key string, ptr any) error

解析到结构体指针

func (BodyMap) EncodeURLParams

func (bm BodyMap) EncodeURLParams() string

("bar=baz&foo=quux") sorted by key.

func (BodyMap) GetAny added in v0.0.5

func (bm BodyMap) GetAny(key string) any

获取原始参数

func (BodyMap) GetInterface deprecated

func (bm BodyMap) GetInterface(key string) any

Deprecated: Use GetAny instead. 获取原始参数

func (BodyMap) GetString

func (bm BodyMap) GetString(key string) string

获取参数转换string

func (BodyMap) JsonBody

func (bm BodyMap) JsonBody() (jb string)

func (BodyMap) MarshalXML

func (bm BodyMap) MarshalXML(e *xml.Encoder, start xml.StartElement) (err error)

func (BodyMap) Range added in v0.0.4

func (bm BodyMap) Range(f func(k string, v any) bool)

func (BodyMap) Remove

func (bm BodyMap) Remove(key string)

删除参数

func (BodyMap) Reset

func (bm BodyMap) Reset()

置空BodyMap

func (BodyMap) Set

func (bm BodyMap) Set(key string, value any) BodyMap

设置参数

func (BodyMap) SetBodyMap

func (bm BodyMap) SetBodyMap(key string, value func(bm BodyMap)) BodyMap

func (BodyMap) SetFormFile

func (bm BodyMap) SetFormFile(key string, file *File) BodyMap

设置 FormFile

func (BodyMap) Unmarshal added in v0.0.3

func (bm BodyMap) Unmarshal(jsonBs []byte) error

unmarshal JSON bytes in BodyMap

func (BodyMap) UnmarshalString added in v0.0.3

func (bm BodyMap) UnmarshalString(jsonStr string) error

func (*BodyMap) UnmarshalXML

func (bm *BodyMap) UnmarshalXML(d *xml.Decoder, _ xml.StartElement) (err error)

type File

type File struct {
	Name    string `json:"name"`
	Content []byte `json:"content"`
}

Jump to

Keyboard shortcuts

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