Documentation ¶
Overview ¶
Package fake_cloud is a test-double implementation of cloudprovider Interface, TCPLoadBalancer and Instances. It is useful for testing.
Index ¶
- type FakeCloud
- func (f *FakeCloud) ClearCalls()
- func (f *FakeCloud) Clusters() (cloudprovider.Clusters, bool)
- func (f *FakeCloud) CreateTCPLoadBalancer(name, region string, externalIP net.IP, port int, hosts []string, ...) (net.IP, error)
- func (f *FakeCloud) DeleteTCPLoadBalancer(name, region string) error
- func (f *FakeCloud) ExternalID(instance string) (string, error)
- func (f *FakeCloud) GetNodeResources(name string) (*api.NodeResources, error)
- func (f *FakeCloud) GetZone() (cloudprovider.Zone, error)
- func (f *FakeCloud) IPAddress(instance string) (net.IP, error)
- func (f *FakeCloud) Instances() (cloudprovider.Instances, bool)
- func (f *FakeCloud) List(filter string) ([]string, error)
- func (f *FakeCloud) ListClusters() ([]string, error)
- func (f *FakeCloud) Master(name string) (string, error)
- func (f *FakeCloud) TCPLoadBalancer() (cloudprovider.TCPLoadBalancer, bool)
- func (f *FakeCloud) TCPLoadBalancerExists(name, region string) (bool, error)
- func (f *FakeCloud) UpdateTCPLoadBalancer(name, region string, hosts []string) error
- func (f *FakeCloud) Zones() (cloudprovider.Zones, bool)
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
This section is empty.
Types ¶
type FakeCloud ¶
type FakeCloud struct { Exists bool Err error Calls []string IP net.IP ExtID string Machines []string NodeResources *api.NodeResources ClusterList []string MasterName string ExternalIP net.IP cloudprovider.Zone }
FakeCloud is a test-double implementation of Interface, TCPLoadBalancer and Instances. It is useful for testing.
func (*FakeCloud) ClearCalls ¶
func (f *FakeCloud) ClearCalls()
ClearCalls clears internal record of method calls to this FakeCloud.
func (*FakeCloud) Clusters ¶ added in v0.5.1
func (f *FakeCloud) Clusters() (cloudprovider.Clusters, bool)
func (*FakeCloud) CreateTCPLoadBalancer ¶
func (f *FakeCloud) CreateTCPLoadBalancer(name, region string, externalIP net.IP, port int, hosts []string, affinityType api.AffinityType) (net.IP, error)
CreateTCPLoadBalancer is a test-spy implementation of TCPLoadBalancer.CreateTCPLoadBalancer. It adds an entry "create" into the internal method call record.
func (*FakeCloud) DeleteTCPLoadBalancer ¶
DeleteTCPLoadBalancer is a test-spy implementation of TCPLoadBalancer.DeleteTCPLoadBalancer. It adds an entry "delete" into the internal method call record.
func (*FakeCloud) ExternalID ¶ added in v0.12.0
ExternalID is a test-spy implementation of Instances.ExternalID. It adds an entry "external-id" into the internal method call record.
func (*FakeCloud) GetNodeResources ¶
func (f *FakeCloud) GetNodeResources(name string) (*api.NodeResources, error)
func (*FakeCloud) IPAddress ¶
IPAddress is a test-spy implementation of Instances.IPAddress. It adds an entry "ip-address" into the internal method call record.
func (*FakeCloud) Instances ¶
func (f *FakeCloud) Instances() (cloudprovider.Instances, bool)
Instances returns a fake implementation of Instances.
Actually it just returns f itself.
func (*FakeCloud) List ¶
List is a test-spy implementation of Instances.List. It adds an entry "list" into the internal method call record.
func (*FakeCloud) ListClusters ¶ added in v0.5.1
func (*FakeCloud) TCPLoadBalancer ¶
func (f *FakeCloud) TCPLoadBalancer() (cloudprovider.TCPLoadBalancer, bool)
TCPLoadBalancer returns a fake implementation of TCPLoadBalancer. Actually it just returns f itself.
func (*FakeCloud) TCPLoadBalancerExists ¶
TCPLoadBalancerExists is a stub implementation of TCPLoadBalancer.TCPLoadBalancerExists.
func (*FakeCloud) UpdateTCPLoadBalancer ¶
UpdateTCPLoadBalancer is a test-spy implementation of TCPLoadBalancer.UpdateTCPLoadBalancer. It adds an entry "update" into the internal method call record.