Documentation ¶
Index ¶
- Constants
- func MetricsHandler(cfg MetricsConfig) func(next http.Handler) http.Handler
- func RoleCheck(allowedRoles []Role) func(next http.Handler) http.Handler
- func SysAPIHandler(cfg SysAPIConfig) func(next http.Handler) http.Handler
- func TenantCheck() func(next http.Handler) http.Handler
- func TraceEnhancer(next http.Handler) http.Handler
- type Handler
- type MetricsConfig
- type Role
- type RoleChecker
- type SysAPIConfig
- type TenantChecker
Constants ¶
const APIKeyHeaderKey = "apikey"
APIKeyHeaderKey in this header the right api key should be inserted
const BlobIDHeaderKey = "blobid"
BlobIDHeaderKey is the header for defining a blob id
const FilenameKey = "filename"
FilenameKey key for the headermapping for the file name
const HeaderPrefixKey = "headerprefix"
HeaderPrefixKey all headers with this prefix will be saved, too
const MetricsEndpoint = "/metrics"
MetricsEndpoint endpoint subpath for metrics
const RetentionHeaderKey = "retention"
RetentionHeaderKey is the header for defining a retention time
const TenantHeaderKey = "tenant"
TenantHeaderKey in this header the right tenant should be inserted
const URLParamTenantID = "tntid"
URLParamTenantID url parameter for the tenant id
Variables ¶
This section is empty.
Functions ¶
func MetricsHandler ¶
func MetricsHandler(cfg MetricsConfig) func(next http.Handler) http.Handler
MetricsHandler creates a new directly usable handler
func RoleCheck ¶
RoleCheck implements a simple middleware handler for adding basic http auth to a route.
func SysAPIHandler ¶
func SysAPIHandler(cfg SysAPIConfig) func(next http.Handler) http.Handler
SysAPIHandler creates a new directly usable handler
func TenantCheck ¶
TenantCheck implements a simple middleware handler for adding basic http auth to a route.
Types ¶
type Handler ¶
type Handler interface { // Routes get the routes Routes() (string, *chi.Mux) }
Handler a http REST interface handler
type MetricsConfig ¶
type MetricsConfig struct { // Skip particular requests from the handler SkipFunc func(r *http.Request) bool }
MetricsConfig defining a handler for checking system id and api key
type RoleChecker ¶
RoleChecker interface for checking roles
var RoleCheckerImpl RoleChecker
RoleCheckerImpl the default implementation of the role checker
type SysAPIConfig ¶
type SysAPIConfig struct { Apikey string HeaderKeyMapping map[string]string // Skip particular requests from the handler SkipFunc func(r *http.Request) bool }
SysAPIConfig defining a handler for checking system id and api key
type TenantChecker ¶
TenantChecker interface for checking a tenant
var TntCheckerImpl TenantChecker
TntCheckerImpl default implementation of tenant checker