Documentation ¶
Overview ¶
Package cloudprovider supplies interfaces and implementations for cloud service providers
Index ¶
- type FakeCloud
- func (f *FakeCloud) ClearCalls()
- func (f *FakeCloud) CreateTCPLoadBalancer(name, region string, port int, hosts []string) error
- func (f *FakeCloud) DeleteTCPLoadBalancer(name, region string) error
- func (f *FakeCloud) GetZone() (string, error)
- func (f *FakeCloud) IPAddress(instance string) (net.IP, error)
- func (f *FakeCloud) Instances() (Instances, bool)
- func (f *FakeCloud) List(filter string) ([]string, error)
- func (f *FakeCloud) TCPLoadBalancer() (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() (Zones, bool)
- type GCECloud
- func (gce *GCECloud) CreateTCPLoadBalancer(name, region string, port int, hosts []string) error
- func (gce *GCECloud) DeleteTCPLoadBalancer(name, region string) error
- func (gce *GCECloud) GetZone() (string, error)
- func (gce *GCECloud) IPAddress(instance string) (net.IP, error)
- func (gce *GCECloud) Instances() (Instances, bool)
- func (gce *GCECloud) List(filter string) ([]string, error)
- func (gce *GCECloud) TCPLoadBalancer() (TCPLoadBalancer, bool)
- func (gce *GCECloud) TCPLoadBalancerExists(name, region string) (bool, error)
- func (gce *GCECloud) UpdateTCPLoadBalancer(name, region string, hosts []string) error
- func (gce *GCECloud) Zones() (Zones, bool)
- type Instances
- type Interface
- type TCPLoadBalancer
- type Zones
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 Machines []string Zone string }
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) CreateTCPLoadBalancer ¶
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) 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 ¶
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) TCPLoadBalancer ¶
func (f *FakeCloud) TCPLoadBalancer() (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.
type GCECloud ¶
type GCECloud struct {
// contains filtered or unexported fields
}
GCECloud is an implementation of Interface, TCPLoadBalancer and Instances for Google Compute Engine.
func NewGCECloud ¶
NewGCECloud creates a new instance of GCECloud.
func (*GCECloud) CreateTCPLoadBalancer ¶
CreateTCPLoadBalancer is an implementation of TCPLoadBalancer.CreateTCPLoadBalancer.
func (*GCECloud) DeleteTCPLoadBalancer ¶
DeleteTCPLoadBalancer is an implementation of TCPLoadBalancer.DeleteTCPLoadBalancer.
func (*GCECloud) Instances ¶
Instances returns an implementation of Instances for Google Compute Engine.
func (*GCECloud) TCPLoadBalancer ¶
func (gce *GCECloud) TCPLoadBalancer() (TCPLoadBalancer, bool)
TCPLoadBalancer returns an implementation of TCPLoadBalancer for Google Compute Engine.
func (*GCECloud) TCPLoadBalancerExists ¶
TCPLoadBalancerExists is an implementation of TCPLoadBalancer.TCPLoadBalancerExists.
func (*GCECloud) UpdateTCPLoadBalancer ¶
UpdateTCPLoadBalancer is an implementation of TCPLoadBalancer.UpdateTCPLoadBalancer.
type Instances ¶
type Instances interface { // IPAddress returns an IP address of the specified instance. IPAddress(name string) (net.IP, error) // List lists instances that match 'filter' which is a regular expression which must match the entire instance name (fqdn) List(filter string) ([]string, error) }
Instances is an abstract, pluggable interface for sets of instances.
type Interface ¶
type Interface interface { // TCPLoadBalancer returns a balancer interface. Also returns true if the interface is supported, false otherwise. TCPLoadBalancer() (TCPLoadBalancer, bool) // Instances returns an instances interface. Also returns true if the interface is supported, false otherwise. Instances() (Instances, bool) // Zones returns a zones interface. Also returns true if the interface is supported, false otherwise. Zones() (Zones, bool) }
Interface is an abstract, pluggable interface for cloud providers
type TCPLoadBalancer ¶
type TCPLoadBalancer interface { // TCPLoadBalancerExists returns whether the specified load balancer exists. // TODO: Break this up into different interfaces (LB, etc) when we have more than one type of service TCPLoadBalancerExists(name, region string) (bool, error) // CreateTCPLoadBalancer creates a new tcp load balancer. CreateTCPLoadBalancer(name, region string, port int, hosts []string) error // UpdateTCPLoadBalancer updates hosts under the specified load balancer. UpdateTCPLoadBalancer(name, region string, hosts []string) error // DeleteTCPLoadBalancer deletes a specified load balancer. DeleteTCPLoadBalancer(name, region string) error }
TCPLoadBalancer is an abstract, pluggable interface for TCP load balancers.