Documentation
¶
Index ¶
- func ACOEnabled(cfg *service.Config) func(next http.Handler) http.Handler
- func ConnectionClose(next http.Handler) http.Handler
- func SecurityHeader(next http.Handler) http.Handler
- func SetRequestParamsCtx(ctx context.Context, rp RequestParameters) context.Context
- func V3AccessControl(cfg *service.Config) func(next http.Handler) http.Handler
- func ValidateRequestHeaders(next http.Handler) http.Handler
- func ValidateRequestURL(next http.Handler) http.Handler
- type RateLimitMiddleware
- type RequestParameters
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
func SetRequestParamsCtx ¶
func SetRequestParamsCtx(ctx context.Context, rp RequestParameters) context.Context
TODO: replace this function else where with line 35
func V3AccessControl ¶
func ValidateRequestURL ¶
ValidateRequestURL ensure that request matches certain expectations. Any error that it finds will result in a http.StatusBadRequest response. If successful, it populates the request context with RequestParameters that can be used downstream. These paramters can be retrieved by calling RequestParametersFromContext.
Types ¶
type RateLimitMiddleware ¶
type RateLimitMiddleware struct {
// contains filtered or unexported fields
}
func NewRateLimitMiddleware ¶
func NewRateLimitMiddleware(config *service.Config, db *sql.DB) RateLimitMiddleware
func (RateLimitMiddleware) CheckConcurrentJobs ¶
func (m RateLimitMiddleware) CheckConcurrentJobs(next http.Handler) http.Handler
type RequestParameters ¶
type RequestParameters struct {
Since time.Time
ResourceTypes []string
Version string // e.g. v1, v2
RequestURL string
TypeFilter [][]string
}
func GetRequestParamsFromCtx ¶
func GetRequestParamsFromCtx(ctx context.Context) (RequestParameters, bool)
Click to show internal directories.
Click to hide internal directories.