annotations

package
v1.1.3 Latest Latest
Warning

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

Go to latest
Published: Dec 16, 2024 License: Apache-2.0 Imports: 8 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

View Source
var AnnotationControllers = []*framework.ControllerEntry{

	{
		Controller: &a0.HomeController{}, Prefix: "/",
		Middlewares: []string{
			"example",
		},
	},

	{
		Controller: &a1.UserController{}, Prefix: "/user",
	},
}

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

func main(){
    ...

    component := framework.New()
    component.Application.AddAnnotationControllers(annotations.AnnotationControllers...)

    ...
}
View Source
var AnnotationCrontabs = []*crontab.Worker{

	crontab.NewWorker("0 0 0 * * * *", &a0.ExampleCrontab{}).
		SetGloballyUnique(false).
		SetNodeUnique(true).
		SetRunOnStartup(true),
}

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

func main(){
    ...

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

    ...
}
View Source
var AnnotationHandlers = []*framework.HandlerEntry{

	{
		Handler: a0.PingHandler, Method: "GET", Path: "/ping",
		Middlewares: []string{
			"example",
			"example2",
		},
	},
}

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