web

package
v0.0.0-...-8a04328 Latest Latest
Warning

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

Go to latest
Published: Sep 18, 2018 License: GPL-3.0, GPL-3.0-only Imports: 9 Imported by: 0

Documentation

Index

Constants

View Source
const (
	// LOG_MIDDLEWARE_PRIORITY sets the priority for the log middleware
	LOG_MIDDLEWARE_PRIORITY = 0
	// AUTHENTICATION_MIDDLEWARE_PRIORITY sets the priority for the authentication middleware
	AUTHENTICATION_MIDDLEWARE_PRIORITY = 1
	// PERMISSION_MIDDLEWARE_PRIORITY sets the priority for the permission middleware
	PERMISSION_MIDDLEWARE_PRIORITY = 2
	// STAY_SIGNED_IN_PRIORITY sets the priority for the "stay signed in functionality"
	STAY_SIGNED_IN_PRIORITY = -1
)

some well known middlewares with given priorities

Variables

This section is empty.

Functions

func AddPrioritizedMiddleware

func AddPrioritizedMiddleware(middleware func(http.Handler) http.Handler, priority int) bool

AddPrioritizedMiddleware adds a middleware with a priority to the stack of middlewares for each request. The lower the priority, the earlier this middleware will be executed. All other middlewares will be executed after the prioritized ones. This function will log an error and not adds the middleware if two middlewares with the same priority are given. This function returns a boolean indicating the success of adding the middleware to the stack.

func InitializeServer

func InitializeServer(port int) error

Types

type SuluvirRouter

type SuluvirRouter struct {
	// contains filtered or unexported fields
}

func GetRouter

func GetRouter() *SuluvirRouter

func (*SuluvirRouter) GetMuxRouterForTestingPurposes

func (s *SuluvirRouter) GetMuxRouterForTestingPurposes() *mux.Router

GetMuxRouterForTestingPurposes returns the underlying mus router to be used for testing purposes

func (*SuluvirRouter) GetRoute

func (s *SuluvirRouter) GetRoute(name string) *mux.Route

func (*SuluvirRouter) HandleFunc

func (s *SuluvirRouter) HandleFunc(path string, f func(http.ResponseWriter, *http.Request)) *mux.Route

func (*SuluvirRouter) Handler

func (s *SuluvirRouter) Handler(path string, handler http.Handler) *mux.Route

func (*SuluvirRouter) Subrouter

func (s *SuluvirRouter) Subrouter(pathPrefix string) *SuluvirRouter

Directories

Path Synopsis
api

Jump to

Keyboard shortcuts

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