annotations

package
v1.0.1 Latest Latest
Warning

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

Go to latest
Published: Aug 15, 2024 License: Apache-2.0 Imports: 7 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

View Source
var AnnotationControllers = []*framework.ControllerEntry{
	{
		Controller:  &controllers.Controller{},
		Middlewares: []string{"Example"},
		Prefix:      "/",
	},
}
View Source
var AnnotationCrontab = []*crontab.Worker{
	crontab.NewWorker("0 0 0 * * * *", &a0.ExampleCrontab{}).SetGloballyUnique(false).SetNodeUnique(true).SetRunOnStartup(true),
}

AnnotationCrontab is a crontab list, You can load it in your main() like follow code.

func main(){
    ...

    component := framework.New()
    component.Application.AddAnnotationCrontabs(annotations.AnnotationCrontab...)

    ...
}
View Source
var AnnotationHandlers = []*framework.HandlerEntry{
	{
		Handler:     a0.PingHandler,
		Method:      "",
		Middlewares: []string{"example"},
		Path:        "/ping",
	},
}

AnnotationHandlers is a handler list, You can load it in your main() like follow code.

func main(){
    ...

    component := framework.New()
    component.Application.AddAnnotationHandlers(annotations.AnnotationHandlers...)

    ...
}
View Source
var AnnotationMiddlewares = map[string]iris.Handler{
	"example": a0.ExampleMiddleware,
}

AnnotationMiddlewares is a middleware mapping, You can load it in your main() like follow code.

func main(){
    ...

    component := framework.New()
    component.Application.AddAnnotationMiddlewares(annotations.AnnotationMiddlewares)

    ...
}

Functions

This section is empty.

Types

This section is empty.

Jump to

Keyboard shortcuts

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