requestfactory

package
v1.6.0 Latest Latest
Warning

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

Go to latest
Published: Apr 14, 2021 License: Apache-2.0 Imports: 9 Imported by: 0 modules, 0 packages

The first number is the count of modules that contain a package that imports this one. The module count is a better indicator of popularity than the package count. A module with 100 importing packages is counted only once instead of 100 times, reflecting the fact that the choice to use the package was likely made only once, not 100 times.
A '?' means that the value hasn't been computed yet.

Documentation

Index

Constants

This section is empty.

Variables

View Source
var NamespaceSubResourcesForTest = sets.NewString(namespaceSubresources.List()...)

NamespaceSubResourcesForTest exports namespaceSubresources for testing in pkg/master/master_test.go, so we never drift

Functions

This section is empty.

Types

type RequestInfo

type RequestInfo struct {
	// IsResourceRequest indicates whether or not the request is for an API
	// resource or subresource
	IsResourceRequest bool
	// Path is the URL path of the request
	Path string
	// Verb is the kube verb associated with the request for API requests, not
	// the http verb.  This includes things like list and watch.  for
	// non-resource requests, this is the lowercase http verb
	Verb string

	APIPrefix  string
	APIGroup   string
	APIVersion string
	Namespace  string
	// Resource is the name of the resource being requested.  This is not the
	// kind.  For example: pods
	Resource string
	// Subresource is the name of the subresource being requested.  This is a
	// different resource, scoped to the parent resource, but it may have a
	// different kind.  For instance, /pods has the resource "pods" and the kind
	// "Pod", while /pods/foo/status has the resource "pods", the sub resource
	// "status", and the kind "Pod" (because status operates on pods). The
	// binding resource for a pod though may be /pods/foo/binding, which has
	// resource "pods", subresource "binding", and kind "Binding".
	Subresource string
	// Name is empty for some verbs, but if the request directly indicates a name
	// (not in body content) then this field is filled in.
	Name string
	// Parts are the path parts for the request, always starting with
	// /{resource}/{name}
	Parts []string
}

RequestInfo holds information parsed from the http.Request

type RequestInfoFactory

type RequestInfoFactory struct {
	APIPrefixes          sets.String // without leading and trailing slashes
	GrouplessAPIPrefixes sets.String // without leading and trailing slashes
}

func (*RequestInfoFactory) NewRequestInfo

func (r *RequestInfoFactory) NewRequestInfo(req *http.Request) (*RequestInfo, error)

Jump to

Keyboard shortcuts

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