route

package
v0.3.4 Latest Latest
Warning

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

Go to latest
Published: Nov 25, 2022 License: MIT Imports: 13 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type ConfigureCustomRoutes

type ConfigureCustomRoutes func(g *gin.RouterGroup, locale string, handlers Middlewares, getRelativePath func(key string) (string, bool, gin.HandlerFunc, bool))

ConfigureCustomRoutes : function to configure the custom routes of the web server.

type ConfigureDefaultRoutes

type ConfigureDefaultRoutes func(routes *DefaultRoutes)

ConfigureDefaultRoutes : function to configure the default routes of the web server.

type DefaultRoutes

type DefaultRoutes struct {
	Robots struct {
		Enabled bool
		Paths   struct {
			Get PathProperties
		}
	}
}

DefaultRoutes : definition of the built-in routes.

type Middlewares

type Middlewares struct {
	MustBeAuthenticated func(bool) gin.HandlerFunc
}

Middlewares : collection of the built-in handlers.

type PathProperties

type PathProperties struct {
	Enabled bool
	Path    string
}

PathProperties : properties of a route.

type Router

type Router struct {
	DefaultRoutes DefaultRoutes
	Handlers      Middlewares
	// contains filtered or unexported fields
}

Router : properties to define routes and their rights.

func NewRouter

func NewRouter(e *gin.Engine, locales []string, defaultLocale, cookieName, JWTSecret string) *Router

NewRouter : returns a new Router struct.

func (*Router) LoadCustomRoutes

func (r *Router) LoadCustomRoutes(configureRoutes ConfigureCustomRoutes)

LoadCustomRoutes : load the custom routes.

func (*Router) LoadDefaultRoutes

func (r *Router) LoadDefaultRoutes()

LoadDefaultRoutes : load the default routes.

Directories

Path Synopsis

Jump to

Keyboard shortcuts

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