filter

package
v1.6.0 Latest Latest
Warning

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

Go to latest
Published: Mar 25, 2021 License: Apache-2.0, BSD-2-Clause, BSD-3-Clause, + 8 more Imports: 5 Imported by: 0

Documentation

Index

Constants

View Source
const ClusterNameHeaderKey = "X-TKE-ClusterName"

ClusterNameHeaderKey is the header name of cluster.

View Source
const FuzzyResourceNameHeaderKey = "X-TKE-FuzzyResourceName"

FuzzyResourceNameHeaderKey is the header name of fuzzy resource query name.

View Source
const ProjectNameHeaderKey = "X-TKE-ProjectName"

ProjectNameHeaderKey is the header name of project.

Variables

This section is empty.

Functions

func ClusterFrom

func ClusterFrom(ctx context.Context) string

ClusterFrom get the cluster name from request context.

func FuzzyResourceFrom

func FuzzyResourceFrom(ctx context.Context) string

FuzzyResourceFrom get the fuzzy resource name from request context.

func NamespaceFrom added in v1.3.1

func NamespaceFrom(ctx context.Context) string

ClusterFrom get the cluster name from request context.

func WithCluster

func WithCluster(handler http.Handler) http.Handler

WithCluster creates an http handler that tries to get the cluster name from the given request, and then stores any such cluster name found onto the provided context for the request.

func WithFuzzyResource

func WithFuzzyResource(handler http.Handler) http.Handler

WithFuzzyResource adds the fuzzy resource name to the context of the http access chain.

func WithNamespace added in v1.3.1

func WithNamespace(handler http.Handler) http.Handler

WithNamespace creates an http handler that tries to get the namespace id from the given request query params, and then stores any such namespace found onto the provided context for the request.

func WithRequestBody

func WithRequestBody(handler http.Handler) http.Handler

WithRequestBody adds the request body to the context of the http access chain.

Types

type RequestBody

type RequestBody struct {
	Data        []byte
	ContentType string
}

RequestBody represents the body of HTTP request.

func RequestBodyFrom

func RequestBodyFrom(ctx context.Context) (*RequestBody, bool)

RequestBodyFrom returns the RequestBody object.

Jump to

Keyboard shortcuts

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