plugins

package
v1.14.0-rc7 Latest Latest
Warning

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

Go to latest
Published: Mar 25, 2021 License: MIT Imports: 9 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func ExpandMiddleware

func ExpandMiddleware(main interface{}, mt MiddlewareType) interface{}

ExpandMiddleware wrap the handlers to the main handler

func ExpandRoute

func ExpandRoute(main *web.Route, rt RouteType)

ExpandRoute mount the extra routes to the main web router

func ExpandTailware

func ExpandTailware(main interface{}, at TailwareType) interface{}

ExpandTailware wrap the tailwares to the main handler

func RegisterMiddleware

func RegisterMiddleware(mt MiddlewareType, handler interface{})

RegisterMiddleware register a middleware that to be attached to the specific main handler. this function should be called in plugins' init() function

func RegisterRoute

func RegisterRoute(rt RouteType, f func() *web.Route)

RegisterRoute register an extra route maker that will generate a web route to be attached to the specific main web router. this function should be called in plugins' init() function

func RegisterTailware

func RegisterTailware(at TailwareType, handler interface{})

RegisterTailware register an tailware that to be attached to the specific main handler. the tailware will be executed asynchronously when the main handler is done. this function should be called in plugins' init() function

func WrapEx

func WrapEx(handlers ...interface{}) http.HandlerFunc

WrapEx converts all kinds of routes to standard library one this is a version that can be extended backwards

Types

type MiddlewareType

type MiddlewareType uint8
const (
	MCreatePullRequest MiddlewareType = iota
)

type RouteType

type RouteType uint8
const (
	RNormalRoutes RouteType = iota
)

type TailwareType

type TailwareType uint8
const (
	TMergePullRequest TailwareType = iota
)

Jump to

Keyboard shortcuts

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