middleware

package
v1.0.3 Latest Latest
Warning

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

Go to latest
Published: Sep 3, 2018 License: Apache-2.0 Imports: 8 Imported by: 0

Documentation

Index

Constants

View Source
const (
	//MTServices is key for services
	MTServices = "mt-service"
)

Variables

This section is empty.

Functions

func CheckActive added in v1.0.1

func CheckActive() gin.HandlerFunc

func RegisterServices

func RegisterServices(svc *Services) gin.HandlerFunc

RegisterServices adds services to context

func RequireAdminRole

func RequireAdminRole(ctx *gin.Context)

RequireAdminRole checks if user is admin

Types

type Services

type Services struct {
	MessagesStorage   storages.MessagesStorage
	TemplateStorage   storages.TemplateStorage
	Upstream          upstreams.Upstream
	UpstreamSimple    upstreams.Upstream
	UserManagerClient clients.UserManagerClient
	Active            bool
}

Services is a collection of dependencies to perform server operations

Jump to

Keyboard shortcuts

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