router

package
v0.7.2-beta Latest Latest
Warning

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

Go to latest
Published: Sep 2, 2021 License: MIT Imports: 3 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

View Source
var AppRouter = kernel.HTTRouter{
	Route: []kernel.Route{
		{
			Name:        "home",
			Path:        "/",
			Action:      "HomeController@Main",
			Method:      "GET",
			Description: "Main access to Go-Web application",
			Middleware: []kernel.Middleware{
				middleware.RateLimiterMiddleware{},
				middleware.LoggingMiddleware{},
			},
		},
		{
			Name:        "users",
			Path:        "/users",
			Action:      "UserController@Insert",
			Method:      "POST",
			Description: "Insert new user",
			Middleware: []kernel.Middleware{
				middleware.LoggingMiddleware{},
			},
		},
	},
	Groups: []kernel.Group{
		{
			Name:   "admin",
			Prefix: "/admin",
			Routes: []kernel.Route{
				{
					Name:        "test",
					Path:        "/test",
					Action:      "UserController@Profile",
					Method:      "GET",
					Description: "Test user authentication",
					Middleware: []kernel.Middleware{
						middleware.LoggingMiddleware{},
						middleware.RateLimiterMiddleware{},
						middleware.RefreshTokenMiddleware{},
					},
				},
			},
			Middleware: []kernel.Middleware{
				middleware.AuthMiddleware{},
			},
		},
	},
}
View Source
var AuthRouter = kernel.HTTRouter{
	Route: []kernel.Route{
		{
			Name:        "login",
			Path:        "/login",
			Action:      "AuthController@JWTAuthentication",
			Method:      "POST",
			Validation:  &validation.Credentials{},
			Description: "Perform login",
			Middleware: []kernel.Middleware{
				middleware.LoggingMiddleware{},
			},
		},
		{
			Name:        "basic login",
			Path:        "/basic-auth",
			Action:      "AuthController@BasicAuthentication",
			Method:      "POST",
			Validation:  &validation.Credentials{},
			Description: "Basic authentication",
			Middleware: []kernel.Middleware{
				middleware.LoggingMiddleware{},
			},
		},
	},
}

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