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.
Click to show internal directories.
Click to hide internal directories.