Documentation ¶
Overview ¶
cache package contains a RemoteResourceGetter interface for retrieving remote resource state without exposing the underline clients implementation. It also provide a concrete implementation that use a basic cache mechanism to avoid multiple calls to the remote api-server.
Index ¶
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
This section is empty.
Types ¶
type CachedResourceGetter ¶
type CachedResourceGetter struct {
// contains filtered or unexported fields
}
func NewCachedResourceGetter ¶
func NewCachedResourceGetter(mapper meta.RESTMapper, client dynamic.Interface) *CachedResourceGetter
func (*CachedResourceGetter) Get ¶
func (rg *CachedResourceGetter) Get(ctx context.Context, id resource.ObjectMetadata) (*unstructured.Unstructured, error)
Get implement RemoteResourceGetter interface
type RemoteResourceGetter ¶
type RemoteResourceGetter interface { // Get return the remote status of ObjectMetadata resource or an error Get(context.Context, resource.ObjectMetadata) (*unstructured.Unstructured, error) }
RemoteResourceGetter define the interface for a getter that can retrieve the remote status of a resource identified by its ObjectMetadata, it will return the remote unstructured reppresentation or nil if it wasn't found. An error will be returned only if is not for a not found resource.
Click to show internal directories.
Click to hide internal directories.