contexthandler

package
v0.0.0-test Latest Latest
Warning

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

Go to latest
Published: Nov 24, 2021 License: AGPL-3.0 Imports: 24 Imported by: 0

Documentation

Overview

Package contexthandler contains the ContextHandler service.

Index

Constants

View Source
const (
	InvalidUsernamePassword = "invalid username or password"
	InvalidAPIKey           = "invalid API key"
)
View Source
const InvalidJWT = "Invalid JWT"
View Source
const ServiceName = "ContextHandler"

Variables

This section is empty.

Functions

func FromContext

func FromContext(c context.Context) *models.ReqContext

FromContext returns the ReqContext value stored in a context.Context, if any.

Types

type ContextHandler

type ContextHandler struct {
	Cfg              *setting.Cfg
	AuthTokenService models.UserTokenService
	JWTAuthService   models.JWTService
	RemoteCache      *remotecache.RemoteCache
	RenderService    rendering.Service
	SQLStore         *sqlstore.SQLStore

	// GetTime returns the current time.
	// Stubbable by tests.
	GetTime func() time.Time
}

ContextHandler is a middleware.

func ProvideService

func ProvideService(cfg *setting.Cfg, tokenService models.UserTokenService, jwtService models.JWTService,
	remoteCache *remotecache.RemoteCache, renderService rendering.Service, sqlStore *sqlstore.SQLStore) *ContextHandler

func (*ContextHandler) Middleware

func (h *ContextHandler) Middleware(mContext *web.Context)

Middleware provides a middleware to initialize the Macaron context.

Directories

Path Synopsis

Jump to

Keyboard shortcuts

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