{"modulePath":"github.com/dockerstack/kubernetes","version":"v0.20.1-0.20150627061651-1c0b765df6da","isLatest":true,"isStandardLibrary":false,"goos":"all","goarch":"all","docs":"# package testclient\n\n## Constants\n\n```go\nconst (\n\tGetControllerAction    = \"get-replicationController\"\n\tUpdateControllerAction = \"update-replicationController\"\n\tWatchControllerAction  = \"watch-replicationController\"\n\tDeleteControllerAction = \"delete-replicationController\"\n\tListControllerAction   = \"list-replicationControllers\"\n\tCreateControllerAction = \"create-replicationController\"\n)\n```\n\n## Functions\n\n```go\nfunc AddObjectsFromPath(path string, o ObjectRetriever, decoder runtime.Decoder) error\n```\nAddObjectsFromPath loads the JSON or YAML file containing Kubernetes API resources and adds them to the provided ObjectRetriever.\n\n## Types\n\n```go\ntype Fake struct {\n\tActions []FakeAction\n\tWatch   watch.Interface\n\tErr     error\n\n\t// ReactFn is an optional function that will be invoked with the provided action\n\t// and return a response. It can implement scenario specific behavior. The type\n\t// of object returned must match the expected type from the caller (even if nil).\n\tReactFn ReactionFunc\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 NewSimpleFake(objects ...runtime.Object) *Fake\n```\nNewSimpleFake returns a client that will respond with the provided objects\n\n```go\nfunc (c *Fake) ComponentStatuses() client.ComponentStatusInterface\n```\n\n```go\nfunc (c *Fake) Endpoints(namespace string) client.EndpointsInterface\n```\n\n```go\nfunc (c *Fake) Events(namespace string) client.EventInterface\n```\n\n```go\nfunc (c *Fake) Invokes(action FakeAction, obj runtime.Object) (runtime.Object, error)\n```\nInvokes records the provided FakeAction and then invokes the ReactFn (if provided). obj is expected to be of the same type a normal call would return.\n\n```go\nfunc (c *Fake) LimitRanges(namespace string) client.LimitRangeInterface\n```\n\n```go\nfunc (c *Fake) Namespaces() client.NamespaceInterface\n```\n\n```go\nfunc (c *Fake) Nodes() client.NodeInterface\n```\n\n```go\nfunc (c *Fake) PersistentVolumeClaims(namespace string) client.PersistentVolumeClaimInterface\n```\n\n```go\nfunc (c *Fake) PersistentVolumes() client.PersistentVolumeInterface\n```\n\n```go\nfunc (c *Fake) PodTemplates(namespace string) client.PodTemplateInterface\n```\n\n```go\nfunc (c *Fake) Pods(namespace string) client.PodInterface\n```\n\n```go\nfunc (c *Fake) ReplicationControllers(namespace string) client.ReplicationControllerInterface\n```\n\n```go\nfunc (c *Fake) ResourceQuotas(namespace string) client.ResourceQuotaInterface\n```\n\n```go\nfunc (c *Fake) Secrets(namespace string) client.SecretsInterface\n```\n\n```go\nfunc (c *Fake) ServerAPIVersions() (*api.APIVersions, error)\n```\n\n```go\nfunc (c *Fake) ServerVersion() (*version.Info, error)\n```\n\n```go\nfunc (c *Fake) ServiceAccounts(namespace string) client.ServiceAccountsInterface\n```\n\n```go\nfunc (c *Fake) Services(namespace string) client.ServiceInterface\n```\n\n```go\ntype FakeAction struct {\n\tAction string\n\tValue  interface{}\n}\n```\n\n```go\ntype FakeComponentStatuses struct {\n\tFake *Fake\n}\n```\nFake implements ComponentStatusInterface.\n\n```go\nfunc (c *FakeComponentStatuses) Get(name string) (*api.ComponentStatus, error)\n```\n\n```go\nfunc (c *FakeComponentStatuses) List(label labels.Selector, field fields.Selector) (result *api.ComponentStatusList, err error)\n```\n\n```go\ntype FakeEndpoints struct {\n\tFake      *Fake\n\tNamespace string\n}\n```\nFakeEndpoints implements EndpointInterface. 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 *FakeEndpoints) Create(endpoints *api.Endpoints) (*api.Endpoints, error)\n```\n\n```go\nfunc (c *FakeEndpoints) Delete(name string) error\n```\n\n```go\nfunc (c *FakeEndpoints) Get(name string) (*api.Endpoints, error)\n```\n\n```go\nfunc (c *FakeEndpoints) List(selector labels.Selector) (*api.EndpointsList, error)\n```\n\n```go\nfunc (c *FakeEndpoints) Update(endpoints *api.Endpoints) (*api.Endpoints, error)\n```\n\n```go\nfunc (c *FakeEndpoints) Watch(label labels.Selector, field fields.Selector, resourceVersion string) (watch.Interface, error)\n```\n\n```go\ntype FakeEvents struct {\n\tFake *Fake\n}\n```\nFakeEvents implements EventInterface. 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 *FakeEvents) Create(event *api.Event) (*api.Event, error)\n```\nCreate makes a new event. Returns the copy of the event the server returns, or an error.\n\n```go\nfunc (c *FakeEvents) Delete(name string) error\n```\n\n```go\nfunc (c *FakeEvents) Get(id string) (*api.Event, error)\n```\nGet returns the given event, or an error.\n\n```go\nfunc (c *FakeEvents) GetFieldSelector(involvedObjectName, involvedObjectNamespace, involvedObjectKind, involvedObjectUID *string) fields.Selector\n```\n\n```go\nfunc (c *FakeEvents) List(label labels.Selector, field fields.Selector) (*api.EventList, error)\n```\nList returns a list of events matching the selectors.\n\n```go\nfunc (c *FakeEvents) Search(objOrRef runtime.Object) (*api.EventList, error)\n```\nSearch returns a list of events matching the specified object.\n\n```go\nfunc (c *FakeEvents) Update(event *api.Event) (*api.Event, error)\n```\nUpdate replaces an existing event. Returns the copy of the event the server returns, or an error.\n\n```go\nfunc (c *FakeEvents) Watch(label labels.Selector, field fields.Selector, resourceVersion string) (watch.Interface, error)\n```\nWatch starts watching for events matching the given selectors.\n\n```go\ntype FakeLimitRanges struct {\n\tFake      *Fake\n\tNamespace string\n}\n```\nFakeLimitRanges implements PodsInterface. Meant to be embedded into a struct to get a default implementation. This makes faking out just the methods you want to test easier.\n\n```go\nfunc (c *FakeLimitRanges) Create(limitRange *api.LimitRange) (*api.LimitRange, error)\n```\n\n```go\nfunc (c *FakeLimitRanges) Delete(name string) error\n```\n\n```go\nfunc (c *FakeLimitRanges) Get(name string) (*api.LimitRange, error)\n```\n\n```go\nfunc (c *FakeLimitRanges) List(selector labels.Selector) (*api.LimitRangeList, error)\n```\n\n```go\nfunc (c *FakeLimitRanges) Update(limitRange *api.LimitRange) (*api.LimitRange, error)\n```\n\n```go\nfunc (c *FakeLimitRanges) Watch(label labels.Selector, field fields.Selector, resourceVersion string) (watch.Interface, error)\n```\n\n```go\ntype FakeNamespaces struct {\n\tFake *Fake\n}\n```\nFakeNamespaces implements NamespacesInterface. Meant to be embedded into a struct to get a default implementation. This makes faking out just the methods you want to test easier.\n\n```go\nfunc (c *FakeNamespaces) Create(namespace *api.Namespace) (*api.Namespace, error)\n```\n\n```go\nfunc (c *FakeNamespaces) Delete(name string) error\n```\n\n```go\nfunc (c *FakeNamespaces) Finalize(namespace *api.Namespace) (*api.Namespace, error)\n```\n\n```go\nfunc (c *FakeNamespaces) Get(name string) (*api.Namespace, error)\n```\n\n```go\nfunc (c *FakeNamespaces) List(labels labels.Selector, field fields.Selector) (*api.NamespaceList, error)\n```\n\n```go\nfunc (c *FakeNamespaces) Status(namespace *api.Namespace) (*api.Namespace, error)\n```\n\n```go\nfunc (c *FakeNamespaces) Update(namespace *api.Namespace) (*api.Namespace, error)\n```\n\n```go\nfunc (c *FakeNamespaces) Watch(label labels.Selector, field fields.Selector, resourceVersion string) (watch.Interface, error)\n```\n\n```go\ntype FakeNodes struct {\n\tFake *Fake\n}\n```\nFakeNodes implements MinionInterface. 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 *FakeNodes) Create(minion *api.Node) (*api.Node, error)\n```\n\n```go\nfunc (c *FakeNodes) Delete(name string) error\n```\n\n```go\nfunc (c *FakeNodes) Get(name string) (*api.Node, error)\n```\n\n```go\nfunc (c *FakeNodes) List(label labels.Selector, field fields.Selector) (*api.NodeList, error)\n```\n\n```go\nfunc (c *FakeNodes) Update(minion *api.Node) (*api.Node, error)\n```\n\n```go\nfunc (c *FakeNodes) UpdateStatus(minion *api.Node) (*api.Node, error)\n```\n\n```go\nfunc (c *FakeNodes) Watch(label labels.Selector, field fields.Selector, resourceVersion string) (watch.Interface, error)\n```\n\n```go\ntype FakePersistentVolumeClaims struct {\n\tFake      *Fake\n\tNamespace string\n}\n```\n\n```go\nfunc (c *FakePersistentVolumeClaims) Create(claim *api.PersistentVolumeClaim) (*api.PersistentVolumeClaim, error)\n```\n\n```go\nfunc (c *FakePersistentVolumeClaims) Delete(name string) error\n```\n\n```go\nfunc (c *FakePersistentVolumeClaims) Get(name string) (*api.PersistentVolumeClaim, error)\n```\n\n```go\nfunc (c *FakePersistentVolumeClaims) List(label labels.Selector, field fields.Selector) (*api.PersistentVolumeClaimList, error)\n```\n\n```go\nfunc (c *FakePersistentVolumeClaims) Update(claim *api.PersistentVolumeClaim) (*api.PersistentVolumeClaim, error)\n```\n\n```go\nfunc (c *FakePersistentVolumeClaims) UpdateStatus(claim *api.PersistentVolumeClaim) (*api.PersistentVolumeClaim, error)\n```\n\n```go\nfunc (c *FakePersistentVolumeClaims) Watch(label labels.Selector, field fields.Selector, resourceVersion string) (watch.Interface, error)\n```\n\n```go\ntype FakePersistentVolumes struct {\n\tFake      *Fake\n\tNamespace string\n}\n```\n\n```go\nfunc (c *FakePersistentVolumes) Create(pv *api.PersistentVolume) (*api.PersistentVolume, error)\n```\n\n```go\nfunc (c *FakePersistentVolumes) Delete(name string) error\n```\n\n```go\nfunc (c *FakePersistentVolumes) Get(name string) (*api.PersistentVolume, error)\n```\n\n```go\nfunc (c *FakePersistentVolumes) List(label labels.Selector, field fields.Selector) (*api.PersistentVolumeList, error)\n```\n\n```go\nfunc (c *FakePersistentVolumes) Update(pv *api.PersistentVolume) (*api.PersistentVolume, error)\n```\n\n```go\nfunc (c *FakePersistentVolumes) UpdateStatus(pv *api.PersistentVolume) (*api.PersistentVolume, error)\n```\n\n```go\nfunc (c *FakePersistentVolumes) Watch(label labels.Selector, field fields.Selector, resourceVersion string) (watch.Interface, error)\n```\n\n```go\ntype FakePodTemplates struct {\n\tFake      *Fake\n\tNamespace string\n}\n```\nFakePodTemplates implements PodTemplatesInterface. Meant to be embedded into a struct to get a default implementation. This makes faking out just the methods you want to test easier.\n\n```go\nfunc (c *FakePodTemplates) Create(pod *api.PodTemplate) (*api.PodTemplate, error)\n```\n\n```go\nfunc (c *FakePodTemplates) Delete(name string, options *api.DeleteOptions) error\n```\n\n```go\nfunc (c *FakePodTemplates) Get(name string) (*api.PodTemplate, error)\n```\n\n```go\nfunc (c *FakePodTemplates) List(label labels.Selector, field fields.Selector) (*api.PodTemplateList, error)\n```\n\n```go\nfunc (c *FakePodTemplates) Update(pod *api.PodTemplate) (*api.PodTemplate, error)\n```\n\n```go\nfunc (c *FakePodTemplates) Watch(label labels.Selector, field fields.Selector, resourceVersion string) (watch.Interface, error)\n```\n\n```go\ntype FakePods struct {\n\tFake      *Fake\n\tNamespace string\n}\n```\nFakePods implements PodsInterface. Meant to be embedded into a struct to get a default implementation. This makes faking out just the methods you want to test easier.\n\n```go\nfunc (c *FakePods) Bind(bind *api.Binding) error\n```\n\n```go\nfunc (c *FakePods) Create(pod *api.Pod) (*api.Pod, error)\n```\n\n```go\nfunc (c *FakePods) Delete(name string, options *api.DeleteOptions) error\n```\n\n```go\nfunc (c *FakePods) Get(name string) (*api.Pod, error)\n```\n\n```go\nfunc (c *FakePods) List(label labels.Selector, field fields.Selector) (*api.PodList, error)\n```\n\n```go\nfunc (c *FakePods) Update(pod *api.Pod) (*api.Pod, error)\n```\n\n```go\nfunc (c *FakePods) UpdateStatus(pod *api.Pod) (*api.Pod, error)\n```\n\n```go\nfunc (c *FakePods) Watch(label labels.Selector, field fields.Selector, resourceVersion string) (watch.Interface, error)\n```\n\n```go\ntype FakeReplicationControllers struct {\n\tFake      *Fake\n\tNamespace string\n}\n```\nFakeReplicationControllers implements ReplicationControllerInterface. 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 *FakeReplicationControllers) Create(controller *api.ReplicationController) (*api.ReplicationController, error)\n```\n\n```go\nfunc (c *FakeReplicationControllers) Delete(name string) error\n```\n\n```go\nfunc (c *FakeReplicationControllers) Get(name string) (*api.ReplicationController, error)\n```\n\n```go\nfunc (c *FakeReplicationControllers) List(selector labels.Selector) (*api.ReplicationControllerList, error)\n```\n\n```go\nfunc (c *FakeReplicationControllers) Update(controller *api.ReplicationController) (*api.ReplicationController, error)\n```\n\n```go\nfunc (c *FakeReplicationControllers) Watch(label labels.Selector, field fields.Selector, resourceVersion string) (watch.Interface, error)\n```\n\n```go\ntype FakeResourceQuotas struct {\n\tFake      *Fake\n\tNamespace string\n}\n```\nFakeResourceQuotas implements ResourceQuotaInterface. Meant to be embedded into a struct to get a default implementation. This makes faking out just the methods you want to test easier.\n\n```go\nfunc (c *FakeResourceQuotas) Create(resourceQuota *api.ResourceQuota) (*api.ResourceQuota, error)\n```\n\n```go\nfunc (c *FakeResourceQuotas) Delete(name string) error\n```\n\n```go\nfunc (c *FakeResourceQuotas) Get(name string) (*api.ResourceQuota, error)\n```\n\n```go\nfunc (c *FakeResourceQuotas) List(selector labels.Selector) (*api.ResourceQuotaList, error)\n```\n\n```go\nfunc (c *FakeResourceQuotas) Update(resourceQuota *api.ResourceQuota) (*api.ResourceQuota, error)\n```\n\n```go\nfunc (c *FakeResourceQuotas) UpdateStatus(resourceQuota *api.ResourceQuota) (*api.ResourceQuota, error)\n```\n\n```go\nfunc (c *FakeResourceQuotas) Watch(label labels.Selector, field fields.Selector, resourceVersion string) (watch.Interface, error)\n```\n\n```go\ntype FakeSecrets struct {\n\tFake      *Fake\n\tNamespace string\n}\n```\nFake implements SecretInterface. 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 *FakeSecrets) Create(secret *api.Secret) (*api.Secret, error)\n```\n\n```go\nfunc (c *FakeSecrets) Delete(name string) error\n```\n\n```go\nfunc (c *FakeSecrets) Get(name string) (*api.Secret, error)\n```\n\n```go\nfunc (c *FakeSecrets) List(labels labels.Selector, field fields.Selector) (*api.SecretList, error)\n```\n\n```go\nfunc (c *FakeSecrets) Update(secret *api.Secret) (*api.Secret, error)\n```\n\n```go\nfunc (c *FakeSecrets) Watch(label labels.Selector, field fields.Selector, resourceVersion string) (watch.Interface, error)\n```\n\n```go\ntype FakeServiceAccounts struct {\n\tFake      *Fake\n\tNamespace string\n}\n```\nFakeServiceAccounts implements ServiceAccountsInterface. 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 *FakeServiceAccounts) Create(serviceAccount *api.ServiceAccount) (*api.ServiceAccount, error)\n```\n\n```go\nfunc (c *FakeServiceAccounts) Delete(name string) error\n```\n\n```go\nfunc (c *FakeServiceAccounts) Get(name string) (*api.ServiceAccount, error)\n```\n\n```go\nfunc (c *FakeServiceAccounts) List(labels labels.Selector, field fields.Selector) (*api.ServiceAccountList, error)\n```\n\n```go\nfunc (c *FakeServiceAccounts) Update(serviceAccount *api.ServiceAccount) (*api.ServiceAccount, error)\n```\n\n```go\nfunc (c *FakeServiceAccounts) Watch(label labels.Selector, field fields.Selector, resourceVersion string) (watch.Interface, error)\n```\n\n```go\ntype FakeServices struct {\n\tFake      *Fake\n\tNamespace string\n}\n```\nFake implements ServiceInterface. 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 *FakeServices) Create(service *api.Service) (*api.Service, error)\n```\n\n```go\nfunc (c *FakeServices) Delete(name string) error\n```\n\n```go\nfunc (c *FakeServices) Get(name string) (*api.Service, error)\n```\n\n```go\nfunc (c *FakeServices) List(selector labels.Selector) (*api.ServiceList, error)\n```\n\n```go\nfunc (c *FakeServices) Update(service *api.Service) (*api.Service, error)\n```\n\n```go\nfunc (c *FakeServices) Watch(label labels.Selector, field fields.Selector, resourceVersion string) (watch.Interface, error)\n```\n\n```go\ntype ObjectRetriever interface {\n\t// Kind should return a resource or a list of resources (depending on the provided kind and\n\t// name). It should return an error if the caller should communicate an error to the server.\n\tKind(kind, name string) (runtime.Object, error)\n\t// Add adds a runtime object for test purposes into this object.\n\tAdd(runtime.Object) error\n}\n```\nObjectRetriever abstracts the implementation for retrieving or setting generic objects. It is intended to be used to fake calls to a server by returning objects based on their kind and name.\n\n```go\nfunc NewObjects(scheme runtime.ObjectScheme, decoder runtime.ObjectDecoder) ObjectRetriever\n```\nNewObjects implements the ObjectRetriever interface by introspecting the objects provided to Add() and returning them when the Kind method is invoked. If an api.List object is provided to Add(), each child item is added. If an object is added that is itself a list (PodList, ServiceList) then that is added to the \"PodList\" kind. If no PodList is added, the retriever will take any loaded Pods and return them in a list. If an api.Status is added, and the Details.Kind field is set, that status will be returned instead (as an error if Status != Success, or as a runtime.Object if Status == Success).  If multiple PodLists are provided, they will be returned in order by the Kind call, and the last PodList will be reused for subsequent calls.\n\n```go\ntype ReactionFunc func(FakeAction) (runtime.Object, error)\n```\nReactionFunc is a function that returns an object or error for a given Action\n\n```go\nfunc ObjectReaction(o ObjectRetriever, mapper meta.RESTMapper) ReactionFunc\n```\nObjectReaction returns a ReactionFunc that takes a generic action string of the form \\\u003cverb\u003e-\\\u003cresource\u003e or \\\u003cverb\u003e-\\\u003csubresource\u003e-\\\u003cresource\u003e and attempts to return a runtime Object or error that matches the requested action. For instance, list-replicationControllers should attempt to return a list of replication controllers. This method delegates to the ObjectRetriever interface to satisfy retrieval of lists or retrieval of single items. TODO: add support for sub resources\n\n","path":"github.com/dockerstack/kubernetes/pkg/client/testclient","name":"testclient","synopsis":"","isRedistributable":true}
