memorystore

package
v0.1.2 Latest Latest
Warning

This package is not in the latest version of its module.

Go to latest
Published: Oct 28, 2021 License: Apache-2.0 Imports: 11 Imported by: 0

Documentation

Overview

Package memorystore provides an in-memory Store exposing the client.Client interface.

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type Store

type Store struct {
	// contains filtered or unexported fields
}

Store is an in-memory store implementing client.Client.

Caution: Not all features of client.Client are implemented. Please double-check with the method documentation before using advanced features. Store does *not* check whether objects are actually namespaced or not. For schema.GroupResource of api error, Store returns Kind as Resource, e.g. instead of `v1/pods`, `v1/Pod` is returned.

func New

func New(scheme *runtime.Scheme) *Store

New creates a new Store.

The given scheme is used to extract version information from the objects and to convert them from one representation into another.

func (*Store) Create

func (s *Store) Create(_ context.Context, obj client.Object, opts ...client.CreateOption) error

Create implements client.Create. For client.CreateOption, Raw and DryRun are not supported.

func (*Store) Delete

func (s *Store) Delete(_ context.Context, obj client.Object, opts ...client.DeleteOption) error

Delete implements client.Delete. For client.DeleteOption, DryRun, GracePeriodSeconds, Preconditions and PropagationPolicy are not supported.

func (*Store) DeleteAllOf

func (s *Store) DeleteAllOf(_ context.Context, obj client.Object, opts ...client.DeleteAllOfOption) error

DeleteAllOf implements client.DeleteAllOf. For client.DeleteAllOfOption, check Store.List and Store.Delete for supported options.

func (*Store) Get

func (s *Store) Get(_ context.Context, objectKey client.ObjectKey, obj client.Object) error

Get implements client.Get.

func (*Store) GroupKindObjects

func (s *Store) GroupKindObjects(gk schema.GroupKind) []client.Object

GroupKindObjects returns all objects that are registered for the given schema.GroupKind.

func (*Store) GroupKinds

func (s *Store) GroupKinds() []schema.GroupKind

GroupKinds returns a slice of unique schema.GroupKind instances of objects that are registered in this store.

func (*Store) List

func (s *Store) List(_ context.Context, list client.ObjectList, opts ...client.ListOption) error

List implements client.List. For client.ListOption, Raw, Continue, Limit and FieldSelector are not supported.

func (*Store) Objects

func (s *Store) Objects() []client.Object

Objects returns all objects that are stored in this store.

func (*Store) Patch

Patch implements client.Patch. Caution: Patch is not supported / implemented.

func (*Store) RESTMapper

func (s *Store) RESTMapper() meta.RESTMapper

RESTMapper implements client.Client. Caution: For Store, this returns nil.

func (*Store) Scheme

func (s *Store) Scheme() *runtime.Scheme

Scheme returns the used scheme of the Store.

func (*Store) Status

func (s *Store) Status() client.StatusWriter

Status implements client.Status. Caution: Status does not disallow updates to fields other than status.

func (*Store) Update

func (s *Store) Update(_ context.Context, obj client.Object, opts ...client.UpdateOption) error

Update implements client.Update. For client.Update, DryRun, Raw and FieldManager are not supported.

Jump to

Keyboard shortcuts

? : This menu
/ : Search site
f or F : Jump to
y or Y : Canonical URL