Documentation ¶
Index ¶
- Constants
- func ClusterFrom(ctx context.Context) string
- func FuzzyResourceFrom(ctx context.Context) string
- func ToClusterProviderUser(user user.Info) clusterprovider.UserInfo
- func WithCluster(handler http.Handler) http.Handler
- func WithFuzzyResource(handler http.Handler) http.Handler
- func WithRequestBody(handler http.Handler) http.Handler
- type RequestBody
Constants ¶
View Source
const ClusterNameHeaderKey = "X-TKE-ClusterName"
ClusterNameHeaderKey is the header name of cluster
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 ToClusterProviderUser ¶
func ToClusterProviderUser(user user.Info) clusterprovider.UserInfo
ToClusterProviderUser returns the UserInfo object by given userInfo.
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.
Types ¶
type RequestBody ¶
RequestBody represents the body of HTTP request.
func RequestBodyFrom ¶
func RequestBodyFrom(ctx context.Context) (*RequestBody, bool)
RequestBodyFrom returns the RequestBody object.
Click to show internal directories.
Click to hide internal directories.