{"modulePath":"github.com/RedAFD/code-core","version":"v1.14.0-rc5","isLatest":false,"isStandardLibrary":false,"goos":"all","goarch":"all","docs":"# package plugin\n\n## Functions\n\n```go\nfunc ExpandAsyncjob(main interface{}, at AsyncjobType) interface{}\n```\nExpandAsyncjob wrap the async job handler to the main handler\n\n```go\nfunc ExpandMiddleware(main interface{}, mt MiddlewareType) interface{}\n```\nExpandMiddleware wrap the handlers to the main handler\n\n```go\nfunc ExpandRoute(main *web.Route, rt RouteType)\n```\nExpandRoute mount the extra routes to the main web router\n\n```go\nfunc RegisterAsyncjob(at AsyncjobType, handler interface{})\n```\nRegisterAsyncjob register an asynchronous job that to be attached to the specific main handler. the job will be executed asynchronously when the main handler is done. this function should be called in plugins' init() function\n\n```go\nfunc RegisterMiddleware(mt MiddlewareType, handler interface{})\n```\nRegisterMiddleware register a middleware that to be attached to the specific main handler. this function should be called in plugins' init() function\n\n```go\nfunc RegisterRoute(rt RouteType, f func() *web.Route)\n```\nRegisterRoute 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\n\n```go\nfunc WrapEx(handlers ...interface{}) http.HandlerFunc\n```\nWrapEx converts all kinds of routes to standard library one this is a version that can be extended backwards\n\n## Types\n\n```go\ntype AsyncjobType uint8\n```\n\n```go\nconst (\n\tAMergePullRequest AsyncjobType = iota\n)\n```\n\n```go\ntype MiddlewareType uint8\n```\n\n```go\nconst (\n\tMCreatePullRequest MiddlewareType = iota\n)\n```\n\n```go\ntype RouteType uint8\n```\n\n```go\nconst (\n\tRNormalRoutes RouteType = iota\n)\n```\n\n","path":"github.com/RedAFD/code-core/routers/plugin","name":"plugin","synopsis":"","isRedistributable":true}
