Documentation ¶
Index ¶
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
This section is empty.
Types ¶
type NamespacedStorage ¶
type NamespacedStorage map[string]TypedStorage
NamespacedStorage is a map of namespaces to TypedStorage
func (NamespacedStorage) Delete ¶
func (s NamespacedStorage) Delete(ns, tipe, name string)
Delete removes an object from storage, given a namepace, type, and name
func (NamespacedStorage) Get ¶
func (s NamespacedStorage) Get(ns, tipe, name string) runtime.Object
Get returns an object from storage, given a namespace, type, and name
type ObjStorage ¶
ObjStorage is a map of object names to objects
type RESTClient ¶
type RESTClient struct { Storage NamespacedStorage Watcher *Watcher *fakerestclient.RESTClient // contains filtered or unexported fields }
RESTClient is a fake implementation of rest.Interface used to facilitate testing. It short-circuits all HTTP requests that would ordinarily go upstream to a core apiserver. It muxes those requests in-process, uses in-memory storage, and responds just as a core apiserver would.
func NewRESTClient ¶
func NewRESTClient(newEmptyObj func() runtime.Object) *RESTClient
NewRESTClient returns a new FakeCoreRESTClient
type TypedStorage ¶
type TypedStorage map[string]ObjStorage
TypedStorage is a map of types to ObjStorage
func NewTypedStorage ¶
func NewTypedStorage() TypedStorage
NewTypedStorage returns a new TypedStorage
type Watcher ¶
type Watcher struct {
// contains filtered or unexported fields
}
Watcher is a completely in-memory watcher mechanism for use in the fake REST client. This construct sends and receives on the same stream regardless of the type of object, its namespace, or anything else.
Also note that this is not the same thing as a watch.Interface.
func (*Watcher) Close ¶
func (w *Watcher) Close()
Close closes this watcher. All calls to SendObject after this func is called will cause a panic, and all channels returned by ReceiveChan, before or after this function is called, will be closed
func (*Watcher) ReceiveChan ¶
ReceiveChan returns a read-only channel that can be used to receive events sent via this watcher