router

package
v0.0.0-...-07bccb4 Latest Latest
Warning

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

Go to latest
Published: Sep 24, 2023 License: GPL-3.0 Imports: 12 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func BindReq

func BindReq(ctx context.Context, c *app.RequestContext, req *Request) error

func LogReq

func LogReq(ctx context.Context, c *app.RequestContext, req *Request) error

func MustRegValidate

func MustRegValidate()

func Register

func Register(h *server.Hertz)

func ValidateReq

func ValidateReq(ctx context.Context, c *app.RequestContext, req *Request) error

func Warp

func Warp(handler Handler, warpOpts ...WarpOption) func(ctx context.Context, c *app.RequestContext)

Types

type Handler

type Handler func(ctx context.Context, req Request) (resp Response, err error)

type Request

type Request struct {
	Token  string `query:"token" vd:"ValidateToken($)"`
	Config string `query:"config"`
}

type Response

type Response struct {
	Data interface{}
}

type WarpOption

type WarpOption func(ctx context.Context, c *app.RequestContext, req *Request) error

Jump to

Keyboard shortcuts

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