parse_body

package
v0.0.0-...-18988c4 Latest Latest
Warning

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

Go to latest
Published: Nov 5, 2024 License: Apache-2.0 Imports: 10 Imported by: 0

Documentation

Overview

Package parse_body ...

Description : parse_body ...

Author : go_developer@163.com<白茶清欢>

Date : 2024-10-22 16:51

Package parse_body ...

Description : parse_body ...

Author : go_developer@163.com<白茶清欢>

Date : 2024-10-22 16:43

Package parse_body ...

Description : parse_body ...

Author : go_developer@163.com<白茶清欢>

Date : 2024-10-22 16:43

Package parse_body ...

Description : parse_body ...

Author : go_developer@163.com<白茶清欢>

Date : 2024-10-22 16:42

Package parse_body ...

Description : parse_body ...

Author : go_developer@163.com<白茶清欢>

Date : 2024-10-22 16:42

Package parse_body ...

Description : parse_body ...

Author : go_developer@163.com<白茶清欢>

Date : 2024-10-22 16:43

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func Execute

func Execute(ctx *gin.Context, receiver any) ([]byte, error)

Execute 解析请求BODY数据

func ExecuteForMap

func ExecuteForMap(ctx *gin.Context) (map[string]any, error)

ExecuteForMap 高层级包装,表单解析为map

func Register

func Register(adaptor abstract.RequestBodyParseAdaptor)

Register 注册适配器实例

Author : go_developer@163.com<白茶清欢>

Date : 16:45 2024/10/22

Types

type FormUrlEncode

type FormUrlEncode struct {
	// contains filtered or unexported fields
}

func (FormUrlEncode) ContentType

func (f FormUrlEncode) ContentType() string

func (FormUrlEncode) DoParse

func (b FormUrlEncode) DoParse(ctx *gin.Context, receiver any, unmarshalFunc func(sourceData []byte, receiver any) error) ([]byte, error)

DoParse 解析

Author : go_developer@163.com<白茶清欢>

Date : 17:08 2024/10/22

func (FormUrlEncode) Parse

func (f FormUrlEncode) Parse(ctx *gin.Context, receiver any) ([]byte, error)

func (FormUrlEncode) Unmarshal

func (b FormUrlEncode) Unmarshal() func(sourceData []byte, receiver any) error

Unmarshal 反序列化方法,可以不指定

Author : go_developer@163.com<白茶清欢>

Date : 16:54 2024/10/22

type JsonAdaptor

type JsonAdaptor struct {
	// contains filtered or unexported fields
}

func (JsonAdaptor) ContentType

func (j JsonAdaptor) ContentType() string

ContentType 请求类型固定返回json

Author : go_developer@163.com<白茶清欢>

Date : 16:59 2024/10/22

func (JsonAdaptor) DoParse

func (b JsonAdaptor) DoParse(ctx *gin.Context, receiver any, unmarshalFunc func(sourceData []byte, receiver any) error) ([]byte, error)

DoParse 解析

Author : go_developer@163.com<白茶清欢>

Date : 17:08 2024/10/22

func (JsonAdaptor) Parse

func (j JsonAdaptor) Parse(ctx *gin.Context, receiver any) ([]byte, error)

Parse 解析json请求体

Author : go_developer@163.com<白茶清欢>

Date : 17:13 2024/10/22

func (JsonAdaptor) Unmarshal

func (j JsonAdaptor) Unmarshal() func(sourceData []byte, receiver any) error

Unmarshal 指定解析方法

Author : go_developer@163.com<白茶清欢>

Date : 16:56 2024/10/22

type XmlAdaptor

type XmlAdaptor struct {
	// contains filtered or unexported fields
}

func (XmlAdaptor) ContentType

func (x XmlAdaptor) ContentType() string

func (XmlAdaptor) DoParse

func (b XmlAdaptor) DoParse(ctx *gin.Context, receiver any, unmarshalFunc func(sourceData []byte, receiver any) error) ([]byte, error)

DoParse 解析

Author : go_developer@163.com<白茶清欢>

Date : 17:08 2024/10/22

func (XmlAdaptor) Parse

func (x XmlAdaptor) Parse(ctx *gin.Context, receiver any) ([]byte, error)

func (XmlAdaptor) Unmarshal

func (x XmlAdaptor) Unmarshal() func(sourceData []byte, receiver any) error

Jump to

Keyboard shortcuts

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