miniflux/server/middleware/context_keys.go

27 lines
858 B
Go
Raw Normal View History

2017-11-28 06:30:04 +01:00
// Copyright 2017 Frédéric Guillot. All rights reserved.
// Use of this source code is governed by the Apache 2.0
// license that can be found in the LICENSE file.
package middleware
type contextKey struct {
name string
}
var (
// UserIDContextKey is the context key used to store the user ID.
UserIDContextKey = &contextKey{"UserID"}
// UserTimezoneContextKey is the context key used to store the user timezone.
UserTimezoneContextKey = &contextKey{"UserTimezone"}
// IsAdminUserContextKey is the context key used to store the user role.
IsAdminUserContextKey = &contextKey{"IsAdminUser"}
// IsAuthenticatedContextKey is the context key used to store the authentication flag.
IsAuthenticatedContextKey = &contextKey{"IsAuthenticated"}
// CsrfContextKey is the context key used to store CSRF token.
CsrfContextKey = &contextKey{"CSRF"}
)