{"modulePath":"github.com/unitytech/client-go","version":"v11.0.0+incompatible","isLatest":true,"isStandardLibrary":false,"goos":"all","goarch":"all","docs":"# package testing\n\n## Functions\n\n```go\nfunc ExtractFromListOptions(opts interface{}) (labelSelector labels.Selector, fieldSelector fields.Selector, resourceVersion string)\n```\n\n## Types\n\n```go\ntype Action interface {\n\tGetNamespace() string\n\tGetVerb() string\n\tGetResource() schema.GroupVersionResource\n\tGetSubresource() string\n\tMatches(verb, resource string) bool\n\n\t// DeepCopy is used to copy an action to avoid any risk of accidental mutation.  Most people never need to call this\n\t// because the invocation logic deep copies before calls to storage and reactors.\n\tDeepCopy() Action\n}\n```\n\n```go\ntype ActionImpl struct {\n\tNamespace   string\n\tVerb        string\n\tResource    schema.GroupVersionResource\n\tSubresource string\n}\n```\n\n```go\nfunc (a ActionImpl) DeepCopy() Action\n```\n\n```go\nfunc (a ActionImpl) GetNamespace() string\n```\n\n```go\nfunc (a ActionImpl) GetResource() schema.GroupVersionResource\n```\n\n```go\nfunc (a ActionImpl) GetSubresource() string\n```\n\n```go\nfunc (a ActionImpl) GetVerb() string\n```\n\n```go\nfunc (a ActionImpl) Matches(verb, resource string) bool\n```\n\n```go\ntype CreateAction interface {\n\tAction\n\tGetObject() runtime.Object\n}\n```\n\n```go\ntype CreateActionImpl struct {\n\tActionImpl\n\tName   string\n\tObject runtime.Object\n}\n```\n\n```go\nfunc NewCreateAction(resource schema.GroupVersionResource, namespace string, object runtime.Object) CreateActionImpl\n```\n\n```go\nfunc NewCreateSubresourceAction(resource schema.GroupVersionResource, name, subresource, namespace string, object runtime.Object) CreateActionImpl\n```\n\n```go\nfunc NewRootCreateAction(resource schema.GroupVersionResource, object runtime.Object) CreateActionImpl\n```\n\n```go\nfunc NewRootCreateSubresourceAction(resource schema.GroupVersionResource, name, subresource string, object runtime.Object) CreateActionImpl\n```\n\n```go\nfunc (a CreateActionImpl) DeepCopy() Action\n```\n\n```go\nfunc (a CreateActionImpl) GetObject() runtime.Object\n```\n\n```go\ntype DeleteAction interface {\n\tAction\n\tGetName() string\n}\n```\n\n```go\ntype DeleteActionImpl struct {\n\tActionImpl\n\tName string\n}\n```\n\n```go\nfunc NewDeleteAction(resource schema.GroupVersionResource, namespace, name string) DeleteActionImpl\n```\n\n```go\nfunc NewDeleteSubresourceAction(resource schema.GroupVersionResource, subresource, namespace, name string) DeleteActionImpl\n```\n\n```go\nfunc NewRootDeleteAction(resource schema.GroupVersionResource, name string) DeleteActionImpl\n```\n\n```go\nfunc NewRootDeleteSubresourceAction(resource schema.GroupVersionResource, subresource string, name string) DeleteActionImpl\n```\n\n```go\nfunc (a DeleteActionImpl) DeepCopy() Action\n```\n\n```go\nfunc (a DeleteActionImpl) GetName() string\n```\n\n```go\ntype DeleteCollectionAction interface {\n\tAction\n\tGetListRestrictions() ListRestrictions\n}\n```\n\n```go\ntype DeleteCollectionActionImpl struct {\n\tActionImpl\n\tListRestrictions ListRestrictions\n}\n```\n\n```go\nfunc NewDeleteCollectionAction(resource schema.GroupVersionResource, namespace string, opts interface{}) DeleteCollectionActionImpl\n```\n\n```go\nfunc NewRootDeleteCollectionAction(resource schema.GroupVersionResource, opts interface{}) DeleteCollectionActionImpl\n```\n\n```go\nfunc (a DeleteCollectionActionImpl) DeepCopy() Action\n```\n\n```go\nfunc (a DeleteCollectionActionImpl) GetListRestrictions() ListRestrictions\n```\n\n```go\ntype Fake struct {\n\tsync.RWMutex\n\n\t// ReactionChain is the list of reactors that will be attempted for every\n\t// request in the order they are tried.\n\tReactionChain []Reactor\n\t// WatchReactionChain is the list of watch reactors that will be attempted\n\t// for every request in the order they are tried.\n\tWatchReactionChain []WatchReactor\n\t// ProxyReactionChain is the list of proxy reactors that will be attempted\n\t// for every request in the order they are tried.\n\tProxyReactionChain []ProxyReactor\n\n\tResources []*metav1.APIResourceList\n\t// contains filtered or unexported fields\n}\n```\nFake implements client.Interface. Meant to be embedded into a struct to get a default implementation. This makes faking out just the method you want to test easier.\n\n```go\nfunc (c *Fake) Actions() []Action\n```\nActions returns a chronologically ordered slice fake actions called on the fake client.\n\n```go\nfunc (c *Fake) AddProxyReactor(resource string, reaction ProxyReactionFunc)\n```\nAddProxyReactor appends a reactor to the end of the chain.\n\n```go\nfunc (c *Fake) AddReactor(verb, resource string, reaction ReactionFunc)\n```\nAddReactor appends a reactor to the end of the chain.\n\n```go\nfunc (c *Fake) AddWatchReactor(resource string, reaction WatchReactionFunc)\n```\nAddWatchReactor appends a reactor to the end of the chain.\n\n```go\nfunc (c *Fake) ClearActions()\n```\nClearActions clears the history of actions called on the fake client.\n\n```go\nfunc (c *Fake) Invokes(action Action, defaultReturnObj runtime.Object) (runtime.Object, error)\n```\nInvokes records the provided Action and then invokes the ReactionFunc that handles the action if one exists. defaultReturnObj is expected to be of the same type a normal call would return.\n\n```go\nfunc (c *Fake) InvokesProxy(action Action) restclient.ResponseWrapper\n```\nInvokesProxy records the provided Action and then invokes the ReactionFunc that handles the action if one exists.\n\n```go\nfunc (c *Fake) InvokesWatch(action Action) (watch.Interface, error)\n```\nInvokesWatch records the provided Action and then invokes the ReactionFunc that handles the action if one exists.\n\n```go\nfunc (c *Fake) PrependProxyReactor(resource string, reaction ProxyReactionFunc)\n```\nPrependProxyReactor adds a reactor to the beginning of the chain.\n\n```go\nfunc (c *Fake) PrependReactor(verb, resource string, reaction ReactionFunc)\n```\nPrependReactor adds a reactor to the beginning of the chain.\n\n```go\nfunc (c *Fake) PrependWatchReactor(resource string, reaction WatchReactionFunc)\n```\nPrependWatchReactor adds a reactor to the beginning of the chain.\n\n```go\ntype GenericAction interface {\n\tAction\n\tGetValue() interface{}\n}\n```\n\n```go\ntype GenericActionImpl struct {\n\tActionImpl\n\tValue interface{}\n}\n```\n\n```go\nfunc (a GenericActionImpl) DeepCopy() Action\n```\n\n```go\nfunc (a GenericActionImpl) GetValue() interface{}\n```\n\n```go\ntype GetAction interface {\n\tAction\n\tGetName() string\n}\n```\n\n```go\ntype GetActionImpl struct {\n\tActionImpl\n\tName string\n}\n```\n\n```go\nfunc NewGetAction(resource schema.GroupVersionResource, namespace, name string) GetActionImpl\n```\n\n```go\nfunc NewGetSubresourceAction(resource schema.GroupVersionResource, namespace, subresource, name string) GetActionImpl\n```\n\n```go\nfunc NewRootGetAction(resource schema.GroupVersionResource, name string) GetActionImpl\n```\n\n```go\nfunc NewRootGetSubresourceAction(resource schema.GroupVersionResource, subresource, name string) GetActionImpl\n```\n\n```go\nfunc (a GetActionImpl) DeepCopy() Action\n```\n\n```go\nfunc (a GetActionImpl) GetName() string\n```\n\n```go\ntype ListAction interface {\n\tAction\n\tGetListRestrictions() ListRestrictions\n}\n```\n\n```go\ntype ListActionImpl struct {\n\tActionImpl\n\tKind             schema.GroupVersionKind\n\tName             string\n\tListRestrictions ListRestrictions\n}\n```\n\n```go\nfunc NewListAction(resource schema.GroupVersionResource, kind schema.GroupVersionKind, namespace string, opts interface{}) ListActionImpl\n```\n\n```go\nfunc NewRootListAction(resource schema.GroupVersionResource, kind schema.GroupVersionKind, opts interface{}) ListActionImpl\n```\n\n```go\nfunc (a ListActionImpl) DeepCopy() Action\n```\n\n```go\nfunc (a ListActionImpl) GetKind() schema.GroupVersionKind\n```\n\n```go\nfunc (a ListActionImpl) GetListRestrictions() ListRestrictions\n```\n\n```go\ntype ListRestrictions struct {\n\tLabels labels.Selector\n\tFields fields.Selector\n}\n```\n\n```go\ntype ObjectScheme interface {\n\truntime.ObjectCreater\n\truntime.ObjectTyper\n}\n```\nObjectScheme abstracts the implementation of common operations on objects.\n\n```go\ntype ObjectTracker interface {\n\t// Add adds an object to the tracker. If object being added\n\t// is a list, its items are added separately.\n\tAdd(obj runtime.Object) error\n\n\t// Get retrieves the object by its kind, namespace and name.\n\tGet(gvr schema.GroupVersionResource, ns, name string) (runtime.Object, error)\n\n\t// Create adds an object to the tracker in the specified namespace.\n\tCreate(gvr schema.GroupVersionResource, obj runtime.Object, ns string) error\n\n\t// Update updates an existing object in the tracker in the specified namespace.\n\tUpdate(gvr schema.GroupVersionResource, obj runtime.Object, ns string) error\n\n\t// List retrieves all objects of a given kind in the given\n\t// namespace. Only non-List kinds are accepted.\n\tList(gvr schema.GroupVersionResource, gvk schema.GroupVersionKind, ns string) (runtime.Object, error)\n\n\t// Delete deletes an existing object from the tracker. If object\n\t// didn't exist in the tracker prior to deletion, Delete returns\n\t// no error.\n\tDelete(gvr schema.GroupVersionResource, ns, name string) error\n\n\t// Watch watches objects from the tracker. Watch returns a channel\n\t// which will push added / modified / deleted object.\n\tWatch(gvr schema.GroupVersionResource, ns string) (watch.Interface, error)\n}\n```\nObjectTracker keeps track of objects. It is intended to be used to fake calls to a server by returning objects based on their kind, namespace and name.\n\n```go\nfunc NewObjectTracker(scheme ObjectScheme, decoder runtime.Decoder) ObjectTracker\n```\nNewObjectTracker returns an ObjectTracker that can be used to keep track of objects for the fake clientset. Mostly useful for unit tests.\n\n```go\ntype PatchAction interface {\n\tAction\n\tGetName() string\n\tGetPatchType() types.PatchType\n\tGetPatch() []byte\n}\n```\n\n```go\ntype PatchActionImpl struct {\n\tActionImpl\n\tName      string\n\tPatchType types.PatchType\n\tPatch     []byte\n}\n```\n\n```go\nfunc NewPatchAction(resource schema.GroupVersionResource, namespace string, name string, pt types.PatchType, patch []byte) PatchActionImpl\n```\n\n```go\nfunc NewPatchSubresourceAction(resource schema.GroupVersionResource, namespace, name string, pt types.PatchType, patch []byte, subresources ...string) PatchActionImpl\n```\n\n```go\nfunc NewRootPatchAction(resource schema.GroupVersionResource, name string, pt types.PatchType, patch []byte) PatchActionImpl\n```\n\n```go\nfunc NewRootPatchSubresourceAction(resource schema.GroupVersionResource, name string, pt types.PatchType, patch []byte, subresources ...string) PatchActionImpl\n```\n\n```go\nfunc (a PatchActionImpl) DeepCopy() Action\n```\n\n```go\nfunc (a PatchActionImpl) GetName() string\n```\n\n```go\nfunc (a PatchActionImpl) GetPatch() []byte\n```\n\n```go\nfunc (a PatchActionImpl) GetPatchType() types.PatchType\n```\n\n```go\ntype ProxyGetAction interface {\n\tAction\n\tGetScheme() string\n\tGetName() string\n\tGetPort() string\n\tGetPath() string\n\tGetParams() map[string]string\n}\n```\n\n```go\ntype ProxyGetActionImpl struct {\n\tActionImpl\n\tScheme string\n\tName   string\n\tPort   string\n\tPath   string\n\tParams map[string]string\n}\n```\n\n```go\nfunc NewProxyGetAction(resource schema.GroupVersionResource, namespace, scheme, name, port, path string, params map[string]string) ProxyGetActionImpl\n```\n\n```go\nfunc (a ProxyGetActionImpl) DeepCopy() Action\n```\n\n```go\nfunc (a ProxyGetActionImpl) GetName() string\n```\n\n```go\nfunc (a ProxyGetActionImpl) GetParams() map[string]string\n```\n\n```go\nfunc (a ProxyGetActionImpl) GetPath() string\n```\n\n```go\nfunc (a ProxyGetActionImpl) GetPort() string\n```\n\n```go\nfunc (a ProxyGetActionImpl) GetScheme() string\n```\n\n```go\ntype ProxyReactionFunc func(action Action) (handled bool, ret restclient.ResponseWrapper, err error)\n```\nProxyReactionFunc is a function that returns a ResponseWrapper interface for a given Action.  If \"handled\" is false, then the test client will ignore the results and continue to the next ProxyReactionFunc.\n\n```go\ntype ProxyReactor interface {\n\t// Handles indicates whether or not this Reactor deals with a given\n\t// action.\n\tHandles(action Action) bool\n\t// React handles a watch action and returns results.  It may choose to\n\t// delegate by indicating handled=false.\n\tReact(action Action) (handled bool, ret restclient.ResponseWrapper, err error)\n}\n```\nProxyReactor is an interface to allow the composition of proxy get functions.\n\n```go\ntype ReactionFunc func(action Action) (handled bool, ret runtime.Object, err error)\n```\nReactionFunc is a function that returns an object or error for a given Action.  If \"handled\" is false, then the test client will ignore the results and continue to the next ReactionFunc.  A ReactionFunc can describe reactions on subresources by testing the result of the action's GetSubresource() method.\n\n```go\nfunc ObjectReaction(tracker ObjectTracker) ReactionFunc\n```\nObjectReaction returns a ReactionFunc that applies core.Action to the given tracker.\n\n```go\ntype Reactor interface {\n\t// Handles indicates whether or not this Reactor deals with a given\n\t// action.\n\tHandles(action Action) bool\n\t// React handles the action and returns results.  It may choose to\n\t// delegate by indicated handled=false.\n\tReact(action Action) (handled bool, ret runtime.Object, err error)\n}\n```\nReactor is an interface to allow the composition of reaction functions.\n\n```go\ntype SimpleProxyReactor struct {\n\tResource string\n\n\tReaction ProxyReactionFunc\n}\n```\nSimpleProxyReactor is a ProxyReactor.  Each reaction function is attached to a given resource.  \"\\*\" matches everything for that value. For instance, \\*,pods matches all verbs on pods.  This allows for easier composition of reaction functions.\n\n```go\nfunc (r *SimpleProxyReactor) Handles(action Action) bool\n```\n\n```go\nfunc (r *SimpleProxyReactor) React(action Action) (bool, restclient.ResponseWrapper, error)\n```\n\n```go\ntype SimpleReactor struct {\n\tVerb     string\n\tResource string\n\n\tReaction ReactionFunc\n}\n```\nSimpleReactor is a Reactor.  Each reaction function is attached to a given verb,resource tuple.  \"\\*\" in either field matches everything for that value. For instance, \\*,pods matches all verbs on pods.  This allows for easier composition of reaction functions\n\n```go\nfunc (r *SimpleReactor) Handles(action Action) bool\n```\n\n```go\nfunc (r *SimpleReactor) React(action Action) (bool, runtime.Object, error)\n```\n\n```go\ntype SimpleWatchReactor struct {\n\tResource string\n\n\tReaction WatchReactionFunc\n}\n```\nSimpleWatchReactor is a WatchReactor.  Each reaction function is attached to a given resource.  \"\\*\" matches everything for that value. For instance, \\*,pods matches all verbs on pods.  This allows for easier composition of reaction functions\n\n```go\nfunc (r *SimpleWatchReactor) Handles(action Action) bool\n```\n\n```go\nfunc (r *SimpleWatchReactor) React(action Action) (bool, watch.Interface, error)\n```\n\n```go\ntype UpdateAction interface {\n\tAction\n\tGetObject() runtime.Object\n}\n```\n\n```go\ntype UpdateActionImpl struct {\n\tActionImpl\n\tObject runtime.Object\n}\n```\n\n```go\nfunc NewRootUpdateAction(resource schema.GroupVersionResource, object runtime.Object) UpdateActionImpl\n```\n\n```go\nfunc NewRootUpdateSubresourceAction(resource schema.GroupVersionResource, subresource string, object runtime.Object) UpdateActionImpl\n```\n\n```go\nfunc NewUpdateAction(resource schema.GroupVersionResource, namespace string, object runtime.Object) UpdateActionImpl\n```\n\n```go\nfunc NewUpdateSubresourceAction(resource schema.GroupVersionResource, subresource string, namespace string, object runtime.Object) UpdateActionImpl\n```\n\n```go\nfunc (a UpdateActionImpl) DeepCopy() Action\n```\n\n```go\nfunc (a UpdateActionImpl) GetObject() runtime.Object\n```\n\n```go\ntype WatchAction interface {\n\tAction\n\tGetWatchRestrictions() WatchRestrictions\n}\n```\n\n```go\ntype WatchActionImpl struct {\n\tActionImpl\n\tWatchRestrictions WatchRestrictions\n}\n```\n\n```go\nfunc NewRootWatchAction(resource schema.GroupVersionResource, opts interface{}) WatchActionImpl\n```\n\n```go\nfunc NewWatchAction(resource schema.GroupVersionResource, namespace string, opts interface{}) WatchActionImpl\n```\n\n```go\nfunc (a WatchActionImpl) DeepCopy() Action\n```\n\n```go\nfunc (a WatchActionImpl) GetWatchRestrictions() WatchRestrictions\n```\n\n```go\ntype WatchReactionFunc func(action Action) (handled bool, ret watch.Interface, err error)\n```\nWatchReactionFunc is a function that returns a watch interface.  If \"handled\" is false, then the test client will ignore the results and continue to the next ReactionFunc.\n\n```go\nfunc DefaultWatchReactor(watchInterface watch.Interface, err error) WatchReactionFunc\n```\n\n```go\ntype WatchReactor interface {\n\t// Handles indicates whether or not this Reactor deals with a given\n\t// action.\n\tHandles(action Action) bool\n\t// React handles a watch action and returns results.  It may choose to\n\t// delegate by indicating handled=false.\n\tReact(action Action) (handled bool, ret watch.Interface, err error)\n}\n```\nWatchReactor is an interface to allow the composition of watch functions.\n\n```go\ntype WatchRestrictions struct {\n\tLabels          labels.Selector\n\tFields          fields.Selector\n\tResourceVersion string\n}\n```\n\n","path":"github.com/unitytech/client-go/testing","name":"testing","synopsis":"","isRedistributable":true}
