Documentation ¶
Index ¶
- Constants
- func ClusterFrom(ctx context.Context) string
- func FuzzyResourceFrom(ctx context.Context) string
- func NamespaceFrom(ctx context.Context) string
- func WithCluster(handler http.Handler) http.Handler
- func WithFuzzyResource(handler http.Handler) http.Handler
- func WithNamespace(handler http.Handler) http.Handler
- func WithRequestBody(handler http.Handler) http.Handler
- type RequestBody
Constants ¶
const ClusterNameHeaderKey = "X-TKE-ClusterName"
ClusterNameHeaderKey is the header name of cluster.
const FuzzyResourceNameHeaderKey = "X-TKE-FuzzyResourceName"
FuzzyResourceNameHeaderKey is the header name of fuzzy resource query name.
const ProjectNameHeaderKey = "X-TKE-ProjectName"
ProjectNameHeaderKey is the header name of project.
Variables ¶
This section is empty.
Functions ¶
func ClusterFrom ¶
ClusterFrom get the cluster name from request context.
func FuzzyResourceFrom ¶
FuzzyResourceFrom get the fuzzy resource name from request context.
func NamespaceFrom ¶ added in v1.3.1
ClusterFrom get the cluster name from request context.
func WithCluster ¶
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 ¶
WithFuzzyResource adds the fuzzy resource name to the context of the http access chain.
func WithNamespace ¶ added in v1.3.1
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.
Types ¶
type RequestBody ¶
RequestBody represents the body of HTTP request.
func RequestBodyFrom ¶
func RequestBodyFrom(ctx context.Context) (*RequestBody, bool)
RequestBodyFrom returns the RequestBody object.