backends

package
v0.0.0-...-15e29f2 Latest Latest
Warning

This package is not in the latest version of its module.

Go to latest
Published: Jun 2, 2014 License: Apache-2.0 Imports: 17 Imported by: 0

Documentation

Overview

Copyright (C) 2013 The Docker Cloud authors

Licensed under the Apache License, Version 2.0 (the "License"); you may not use this file except in compliance with the License. You may obtain a copy of the License at

http://www.apache.org/licenses/LICENSE-2.0

Unless required by applicable law or agreed to in writing, software distributed under the License is distributed on an "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the License for the specific language governing permissions and limitations under the License.

Licensed under the Apache License, Version 2.0 (the "License"); you may not use this file except in compliance with the License. You may obtain a copy of the License at

http://www.apache.org/licenses/LICENSE-2.0

Unless required by applicable law or agreed to in writing, software distributed under the License is distributed on an "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the License for the specific language governing permissions and limitations under the License.

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func CloudBackend

func CloudBackend() engine.Installer

func ConfigureGCE

func ConfigureGCE(clientId, clientSecret, scope, projectId string) error

func Debug

func Debug() engine.Installer

func Forward

func Forward() engine.Installer

func New

func New() *engine.Engine

New returns a new engine, with all backends registered but not activated. To activate a backend, call a job on the resulting engine, named after the desired backend.

Example: `New().Job("debug").Run()`

func Simulator

func Simulator() engine.Installer

Types

type Cloud

type Cloud interface {
	// GetPublicIPAddress returns the stringified address (e.g "1.2.3.4") of the runtime
	GetPublicIPAddress(name string, zone string) (string, error)

	// CreateInstance creates a virtual machine instance given a name and a zone.  Returns the
	// IP address of the instance.  Waits until Docker is up and functioning on the machine
	// before returning.
	CreateInstance(name string, zone string) (string, error)

	// DeleteInstance deletes a virtual machine instance, given the instance name and zone.
	DeleteInstance(name string, zone string) error

	// Open a secure tunnel (generally SSH) between the local host and a remote host.
	OpenSecureTunnel(name string, zone string, localPort int, remotePort int) (*os.Process, error)
}

The Cloud interface provides the contract that cloud providers should implement to enable running Docker containers in their cloud. TODO(bburns): Restructure this into Cloud, Instance and Tunnel interfaces

type Container

type Container struct {
	Id    string
	Image string
	Tty   bool
}

type GCECloud

type GCECloud struct {
	// contains filtered or unexported fields
}

A Google Compute Engine implementation of the Cloud interface

func NewCloudGCE

func NewCloudGCE(projectId string) (cloud *GCECloud, err error)

Create a GCE Cloud instance. 'clientId', 'clientSecret' and 'scope' are used to ask for a client credential. 'code' is optional and is only used if a cached credential can not be found. 'projectId' is the Google Cloud project name.

func (GCECloud) CreateInstance

func (cloud GCECloud) CreateInstance(name string, zone string) (string, error)

Implementation of the Cloud interface

func (GCECloud) DeleteInstance

func (cloud GCECloud) DeleteInstance(name string, zone string) error

Implementation of the Cloud interface

func (GCECloud) GetPublicIPAddress

func (cloud GCECloud) GetPublicIPAddress(name string, zone string) (string, error)

Implementation of the Cloud interface

func (GCECloud) OpenSecureTunnel

func (cloud GCECloud) OpenSecureTunnel(name, zone string, localPort, remotePort int) (*os.Process, error)

type Tunnel

type Tunnel struct {
	url.URL
}

returns true, if the connection was successful, false otherwise

Jump to

Keyboard shortcuts

? : This menu
/ : Search site
f or F : Jump to
y or Y : Canonical URL