Make a RESTMapper scope aware

This commit is contained in:
derekwaynecarr
2015-01-29 11:35:06 -05:00
parent e335e2d3e2
commit 71ec444d63
5 changed files with 122 additions and 39 deletions

View File

@@ -94,6 +94,21 @@ type MetadataAccessor interface {
runtime.ResourceVersioner
}
// RESTScope contains the information needed to deal with REST Resources that are in a resource hierarchy
type RESTScope struct {
// Name of the scope (e.g. "cluster", "namespace", etc.)
Name string
// ParamName is the optional name of the parameter that should be inserted in the resource url
// If empty, no param will be inserted
ParamName string
// ParamPath is a boolean that controls how the parameter is manifested in resource paths
// If true, this parameter is encoded in path (i.e. /{paramName}/{paramValue})
// If false, this parameter is encoded in query (i.e. ?{paramName}={paramValue})
ParamPath bool
// ParamDescription is the optional description to use to document the parameter in api documentation
ParamDescription string
}
// RESTMapping contains the information needed to deal with objects of a specific
// resource and kind in a RESTful manner.
type RESTMapping struct {
@@ -104,6 +119,9 @@ type RESTMapping struct {
APIVersion string
Kind string
// Scope contains the information needed to deal with REST Resources that are in a resource hierarchy
Scope RESTScope
runtime.Codec
runtime.ObjectConvertor
MetadataAccessor