jet

package
v0.0.2 Latest Latest
Warning

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

Go to latest
Published: Jan 5, 2024 License: MIT Imports: 12 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func AddMiddleware

func AddMiddleware(jetMiddlewareList ...JetMiddleware)

func Invoke

func Invoke(i any)

func NewByInject

func NewByInject(jetControllerList inject.JetControllerList) commands.MainInstance

func Provide

func Provide(constructs ...any)

func RecoverJetMiddleware

func RecoverJetMiddleware(next router.IJetRouter) (router.IJetRouter, error)

func Register

func Register(rcvrs ...any)

func Run

func Run(addr string)

func TraceJetMiddleware

func TraceJetMiddleware(next router.IJetRouter) (router.IJetRouter, error)

Types

type Args

type Args struct {
	CmdArgs    []string
	FormParam1 string `json:"form_param1" form:"form_param1"`
	FormParam2 string `json:"form_param2" form:"form_param1"`
}

type BaseJetController

type BaseJetController struct {
	IJetController
}

BaseJetController Provide some basic hooks, such as parameter validation and restful style returns

func (BaseJetController) PostMethodExecuteHook

func (BaseJetController) PostMethodExecuteHook(param any) (data any, err error)

PostMethodExecuteHook restful

func (BaseJetController) PostParamsParseHook

func (BaseJetController) PostParamsParseHook(param any) (err error)

type ControllerResult

type ControllerResult struct {
	dig.Out
	Handler inject.IJetController `group:"server"`
}

func NewJetController

func NewJetController(controller IJetController) ControllerResult

type Ctx

type Ctx interface {
	context.Ctx
}

Ctx is the most important part of Jet. It allows us to pass variables between middleware, manage the flow, validate the JSON of a request and render a JSON response for example.

type IJetController

type IJetController interface {
	inject.IJetController
}

type JetHandlerFunc

type JetHandlerFunc func(ctx *fasthttp.RequestCtx)

func (JetHandlerFunc) RegisterRouter

func (f JetHandlerFunc) RegisterRouter(path string, handler handler.IHandler)

func (JetHandlerFunc) ServeHTTP

func (f JetHandlerFunc) ServeHTTP(ctx *fasthttp.RequestCtx)

type JetMiddleware

type JetMiddleware func(next router.IJetRouter) (router.IJetRouter, error)

type Server

type Server struct{}

func New

func New() *Server

func (*Server) Destroy

func (j *Server) Destroy()

func (*Server) Initialize

func (j *Server) Initialize() (err error)

func (*Server) RunLoop

func (j *Server) RunLoop()

Jump to

Keyboard shortcuts

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