api

package
v2.3.0 Latest Latest
Warning

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

Go to latest
Published: Mar 20, 2026 License: Apache-2.0 Imports: 7 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func BindAll added in v2.1.4

func BindAll(c *Context, args any) error

NOTE 屏蔽了gin的默认validator,期望先解析出数据再校验数据有效性

Types

type Context

type Context = gin.Context

type Group added in v2.0.8

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

func NewGroup added in v2.0.8

func NewGroup(basePath string, route IRoutes) *Group

func (*Group) Add added in v2.0.8

func (group *Group) Add(method, uri string, h Handler, args any)

func (*Group) DELETE added in v2.1.0

func (group *Group) DELETE(name string, h Handler, args interface{})

func (*Group) GET added in v2.1.0

func (group *Group) GET(name string, h Handler, args interface{})

func (*Group) Handle added in v2.1.0

func (group *Group) Handle(method, uri string, h Handler, args any)

func (*Group) POST added in v2.1.0

func (group *Group) POST(name string, h Handler, args interface{})

func (*Group) PUT added in v2.1.0

func (group *Group) PUT(name string, h Handler, args interface{})

func (*Group) SetRequestReader added in v2.1.0

func (group *Group) SetRequestReader(r RequestReader)

func (*Group) SetResponseWriter added in v2.1.0

func (group *Group) SetResponseWriter(w ResponseWriter)

type Handler

type Handler func(*Context, any) (any, error)

type IRoutes

type IRoutes = gin.IRoutes

type RequestReader added in v2.1.0

type RequestReader interface {
	ReadRequest(*Context, any) error
}

type ResponseResult added in v2.1.0

type ResponseResult struct {
	Data  any
	Error error
}

type ResponseWriter added in v2.1.0

type ResponseWriter interface {
	WriteResponse(*Context, ResponseResult)
}

Jump to

Keyboard shortcuts

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