router

package
v0.0.0-...-f52f705 Latest Latest
Warning

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

Go to latest
Published: Feb 26, 2023 License: Apache-2.0 Imports: 4 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

View Source
var MRoutes *mappingRouter

Functions

This section is empty.

Types

type BaseRequest

type BaseRequest struct {
	Ctx *EasyGoContext
}

BaseRequest 基础的request参数,所有的请求处理handler的参数都应该继承BaseRequest

func (*BaseRequest) InitRequest

func (r *BaseRequest) InitRequest(ctx *EasyGoContext)

type EasyGoContext

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

EasyGoContext request -> mid with RsCtx -> handler(ctx, req, res)

func (EasyGoContext) Context

func (c EasyGoContext) Context() context.Context

func (EasyGoContext) GetEnv

func (c EasyGoContext) GetEnv() string

type EasyGoHandlerFunc

type EasyGoHandlerFunc struct {
	InParameter  []*reflect.Type // 入参列表,按照
	OutParameter []*reflect.Type // 出参列表
	HFunc        reflect.Value   // 处理方法
}

type EasyGoHttpRouter

type EasyGoHttpRouter interface {
	FindHandlerByMethodUrl(method, urlPattern string) (EasyGoHandlerFunc, bool, int)
	RouteRegister
}

type IRequest

type IRequest interface {
	InitRequest(ctx *EasyGoContext)
}

type RestFulGroup

type RestFulGroup struct {
	Ctx *EasyGoContext
}

RestFulGroup 基础的Controller, 所有的实现自动注册的rest风格的api都应该继承RestFulGrouper

func (*RestFulGroup) RegisterRouter

func (c *RestFulGroup) RegisterRouter(ctx *EasyGoContext)

type RestFulGrouper

type RestFulGrouper interface {
	RegisterRouter(ctx *EasyGoContext)
}

type RouteRegister

type RouteRegister interface {
	Get(patten string, handler any)
	Post(patten string, handler any)
	Put(patten string, handler any)
	Delete(patten string, handler any)
	RestGroup(patten string, controller RestFulGrouper)
}

Jump to

Keyboard shortcuts

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