Documentation ¶
Index ¶
- func CreateResource(r rest.Creater, scope RequestScope, typer runtime.ObjectTyper) http.HandlerFunc
- func DeleteResource(r rest.GracefulDeleter, allowsOptions bool, scope RequestScope) http.HandlerFunc
- func GetResource(r rest.Getter, e rest.Exporter, scope RequestScope) http.HandlerFunc
- func ListResource(r rest.Lister, rw rest.Watcher, scope RequestScope, forceWatch bool, ...) http.HandlerFunc
- type ContextBasedNaming
- func (n ContextBasedNaming) GenerateLink(requestInfo *request.RequestInfo, obj runtime.Object) (uri string, err error)
- func (n ContextBasedNaming) GenerateListLink(req *http.Request) (uri string, err error)
- func (n ContextBasedNaming) Name(req *http.Request) (namespace, name string, err error)
- func (n ContextBasedNaming) Namespace(req *http.Request) (namespace string, err error)
- func (n ContextBasedNaming) ObjectName(obj runtime.Object) (namespace, name string, err error)
- func (n ContextBasedNaming) SetSelfLink(obj runtime.Object, url string) error
- type ContextFunc
- type RequestScope
- type ScopeNamer
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
func CreateResource ¶
func CreateResource(r rest.Creater, scope RequestScope, typer runtime.ObjectTyper) http.HandlerFunc
CreateResource returns a function that will handle a resource creation. FIXME (rantuttl): 'Typer' already sent in scope object. Remove from this and associated method signatures
func DeleteResource ¶
func DeleteResource(r rest.GracefulDeleter, allowsOptions bool, scope RequestScope) http.HandlerFunc
DeleteResource returns a function that will handle a resource deletion
func GetResource ¶
func GetResource(r rest.Getter, e rest.Exporter, scope RequestScope) http.HandlerFunc
GetResource returns a function that handles retrieving a single resource from a rest.Storage object.
func ListResource ¶
func ListResource(r rest.Lister, rw rest.Watcher, scope RequestScope, forceWatch bool, minRequestTimeout time.Duration) http.HandlerFunc
Types ¶
type ContextBasedNaming ¶
type ContextBasedNaming struct { GetContext ContextFunc SelfLinker runtime.SelfLinker ClusterScoped bool SelfLinkPathPrefix string SelfLinkPathSuffix string }
func (ContextBasedNaming) GenerateLink ¶
func (n ContextBasedNaming) GenerateLink(requestInfo *request.RequestInfo, obj runtime.Object) (uri string, err error)
func (ContextBasedNaming) GenerateListLink ¶
func (n ContextBasedNaming) GenerateListLink(req *http.Request) (uri string, err error)
func (ContextBasedNaming) Name ¶
func (n ContextBasedNaming) Name(req *http.Request) (namespace, name string, err error)
func (ContextBasedNaming) Namespace ¶
func (n ContextBasedNaming) Namespace(req *http.Request) (namespace string, err error)
func (ContextBasedNaming) ObjectName ¶
func (n ContextBasedNaming) ObjectName(obj runtime.Object) (namespace, name string, err error)
func (ContextBasedNaming) SetSelfLink ¶
func (n ContextBasedNaming) SetSelfLink(obj runtime.Object, url string) error
type ContextFunc ¶
ContextFunc returns a Context given a request - a context must be returned
type RequestScope ¶
type RequestScope struct { Namer ScopeNamer ContextFunc Serializer runtime.NegotiatedSerializer runtime.ParameterCodec Creater runtime.ObjectCreater Convertor runtime.ObjectConvertor Defaulter runtime.ObjectDefaulter Copier runtime.ObjectCopier Typer runtime.ObjectTyper Resource schema.GroupVersionResource Kind schema.GroupVersionKind Subresource string MetaGroupVersion schema.GroupVersion }
RequestScope encapsulates common fields across all RESTful handler methods.
type ScopeNamer ¶
type ScopeNamer interface { // Namespace returns the appropriate namespace value from the request (may be empty) or an // error. Namespace(req *http.Request) (namespace string, err error) // Name returns the name from the request, and an optional namespace value if this is a namespace // scoped call. An error is returned if the name is not available. Name(req *http.Request) (namespace, name string, err error) // ObjectName returns the namespace and name from an object if they exist, or an error if the object // does not support names. ObjectName(obj runtime.Object) (namespace, name string, err error) // SetSelfLink sets the provided URL onto the object. The method should return nil if the object // does not support selfLinks. SetSelfLink(obj runtime.Object, url string) error // GenerateLink creates an encoded URI for a given runtime object that represents the canonical path // and query. GenerateLink(requestInfo *request.RequestInfo, obj runtime.Object) (uri string, err error) // GenerateListLink creates an encoded URI for a list that represents the canonical path and query. GenerateListLink(req *http.Request) (uri string, err error) }
ScopeNamer handles accessing names from requests and objects
Click to show internal directories.
Click to hide internal directories.