encode

package
v1.0.2 Latest Latest
Warning

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

Go to latest
Published: Mar 28, 2026 License: MIT Imports: 10 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type File

type File interface {
	FileName() string
	FileData() []byte
}

type Response

type Response struct {
	Code    string      `JSON:"code"`
	Message string      `JSON:"message"`
	Details interface{} `JSON:"details"`
}

Response 符合swagger返回格式

func NewResponse

func NewResponse(data interface{}, err error) *Response

type Writer

type Writer interface {
	Bind(request any) error

	Context() context.Context
	Request() (request any, requestInfo map[string]any)

	Run(response any, err error)
	WriteErr(err error)
}

func NewFile

func NewFile(ginContext *gin.Context, request any) (Writer, error)

func NewJson

func NewJson(ginContext *gin.Context, request any) (Writer, error)

func NewSSE

func NewSSE(ginContext *gin.Context, request any) (Writer, error)

func NewXML

func NewXML(ginContext *gin.Context, request any) (Writer, error)

Jump to

Keyboard shortcuts

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