Documentation ¶
Overview ¶
Package resourcerest defines interfaces for resource REST implementations.
If a resource implements these interfaces directly on the object, then the resource itself may be used as the request handler, and will be registered as the REST handler by default when builder.APIServer.WithResource is called.
Alternatively, a REST struct may be defined separately from the object and explicitly registered to handle the object with builder.APIServer.WithResourceAndHandler.
Index ¶
- type CategoriesProvider
- type CollectionDeleter
- type Connecter
- type CreaterUpdater
- type Creator
- type Exporter
- type FieldsIndexer
- type Getter
- type GracefulDeleter
- type LabelsIndexer
- type Lister
- type Patcher
- type Redirector
- type Responder
- type ShortNamesProvider
- type StandardStorage
- type TableConvertor
- type Updater
- type Watcher
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
This section is empty.
Types ¶
type CategoriesProvider ¶
type CategoriesProvider = rest.CategoriesProvider
CategoriesProvider allows a resource to specify which groups of resources (categories) it's part of. Categories can be used by API clients to refer to a batch of resources by using a single name (e.g. "all" could translate to "pod,rc,svc,...").
type CollectionDeleter ¶
type CollectionDeleter = rest.CollectionDeleter
CollectionDeleter if implemented will expose DELETE endpoints for resource collections and publish them in the Kubernetes discovery service and OpenAPI.
Required for `kubectl delete --all`
type CreaterUpdater ¶
type CreaterUpdater = rest.CreaterUpdater
CreaterUpdater is a storage object that must support both create and update. Go prevents embedded interfaces that implement the same method.
type Creator ¶
Creator if implemented will expose PUT endpoints for the resource and publish them in the Kubernetes discovery service and OpenAPI.
Required for `kubectl apply`.
type Exporter ¶
Exporter is an object that knows how to strip a RESTful resource for export. A store should implement this interface if export is generally supported for that type. Errors can still be returned during the actual Export when certain instances of the type are not exportable.
type FieldsIndexer ¶
FieldsIndexer indices resources by certain fields at the server-side. TODO: implement it
type Getter ¶
Getter if implemented will expose GET endpoints for the resource and publish them in the Kubernetes discovery service and OpenAPI.
Required for `kubectl apply` and most operators.
type GracefulDeleter ¶
type GracefulDeleter = rest.GracefulDeleter
GracefulDeleter knows how to pass deletion options to allow delayed deletion of a RESTful object.
type LabelsIndexer ¶
type LabelsIndexer interface {
IndexingLabelKeys() []string
}
LabelsIndexer indices resources by their labels at the server-side. TODO: implement it
type Lister ¶
Lister if implemented will enable listing resources.
Required by `kubectl get` and most operators.
type Patcher ¶
Patcher if implemented will expose POST and GET endpoints for the resource and publish them in the Kubernetes discovery service and OpenAPI.
Required by `kubectl apply` and most controllers.
type Redirector ¶
type Redirector = rest.Redirector
Redirector know how to return a remote resource's location.
type Responder ¶
Responder abstracts the normal response behavior for a REST method and is passed to callers that may wish to handle the response directly in some cases, but delegate to the normal error or object behavior in other cases.
type ShortNamesProvider ¶
type ShortNamesProvider = rest.ShortNamesProvider
ShortNamesProvider is an interface for RESTful storage services. Delivers a list of short names for a resource. The list is used by kubectl to have short names representation of resources.
type StandardStorage ¶
type StandardStorage = rest.StandardStorage
StandardStorage defines the standard endpoints for resources.
type TableConvertor ¶
type TableConvertor = rest.TableConvertor
TableConvertor if implemented will return tabular data from the GET endpoint when requested.
Required by pretty printing `kubectl get`.