Files
docker-machine/libmachine/mcndockerclient/docker_host.go
David Gageot 670c4808ed FIX #2663 reduce calls to the driver in ls
Signed-off-by: David Gageot <david@gageot.net>
2015-12-23 13:58:06 +01:00

42 lines
709 B
Go

package mcndockerclient
import (
"fmt"
"github.com/docker/machine/libmachine/auth"
)
type URLer interface {
// URL returns the Docker host URL
URL() (string, error)
}
type AuthOptionser interface {
// AuthOptions returns the authOptions
AuthOptions() *auth.Options
}
type DockerHost interface {
URLer
AuthOptionser
}
type RemoteDocker struct {
HostURL string
AuthOption *auth.Options
}
// URL returns the Docker host URL
func (rd RemoteDocker) URL() (string, error) {
if rd.HostURL == "" {
return "", fmt.Errorf("Docker Host URL not set")
}
return rd.HostURL, nil
}
// AuthOptions returns the authOptions
func (rd RemoteDocker) AuthOptions() *auth.Options {
return rd.AuthOption
}