Add IP look up if the Cloud Provider is not null

Add Instance info to the Cloud Provider interface
This commit is contained in:
Brendan Burns
2014-06-17 21:58:41 -07:00
parent c0d8636f40
commit 57869958bc
3 changed files with 61 additions and 1 deletions

View File

@@ -16,10 +16,16 @@ limitations under the License.
package cloudprovider
import (
"net"
)
// CloudInterface is an abstract, pluggable interface for cloud providers
type Interface interface {
// TCPLoadBalancer returns a balancer interface, or nil if none is supported. Returns an error if one occurs.
TCPLoadBalancer() (TCPLoadBalancer, error)
// Instances returns an instances interface, or nil if none is supported. Returns an error if one occurs.
Instances() (Instances, error)
}
type TCPLoadBalancer interface {
@@ -29,3 +35,7 @@ type TCPLoadBalancer interface {
UpdateTCPLoadBalancer(name, region string, hosts []string) error
DeleteTCPLoadBalancer(name, region string) error
}
type Instances interface {
IPAddress(name string) (net.IP, error)
}