mirror of
https://github.com/k3s-io/kubernetes.git
synced 2026-01-04 23:17:50 +00:00
Make a RESTMapper scope aware
This commit is contained in:
@@ -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
|
||||
|
||||
Reference in New Issue
Block a user