providers

package
v0.0.0-...-0efea45 Latest Latest
Warning

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

Go to latest
Published: Jan 25, 2018 License: MIT Imports: 12 Imported by: 4

Documentation

Index

Constants

View Source
const MaxWaitDuration = time.Minute

Variables

View Source
var (
	NetworkBaseName        = "docker-network-%s-%s"
	DiskDeviceNameBaseName = "docker-volume-%s"
	DiskDevBasePath        = "/dev/disk/by-id/google-%s"
)

Functions

func DiskTypeURL

func DiskTypeURL(project, zone, diskType string) string

func DiskURL

func DiskURL(project, zone, disks string) string

func InstanceURL

func InstanceURL(project, zone, instance string) string

func TargetPoolURL

func TargetPoolURL(project, region, targetPool string) string

Types

type Client

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

func NewClient

func NewClient(c *http.Client, project, zone, instance string) (*Client, error)

func (*Client) WaitDone

func (c *Client) WaitDone(op *compute.Operation) error

type Disk

type Disk struct {
	Client
}

func NewDisk

func NewDisk(c *http.Client, project, zone, instance string) (*Disk, error)

func (*Disk) Attach

func (d *Disk) Attach(c *DiskConfig) error

func (*Disk) Create

func (d *Disk) Create(c *DiskConfig) error

func (*Disk) Delete

func (d *Disk) Delete(c *DiskConfig) error

func (*Disk) Detach

func (d *Disk) Detach(c *DiskConfig) error

func (*Disk) List

func (d *Disk) List() ([]*compute.Disk, error)

type DiskConfig

type DiskConfig struct {
	Name           string
	Type           string
	SizeGb         int64
	SourceSnapshot string
	SourceImage    string
}

func (*DiskConfig) Dev

func (c *DiskConfig) Dev() string

func (*DiskConfig) DeviceName

func (c *DiskConfig) DeviceName() string

func (*DiskConfig) Disk

func (c *DiskConfig) Disk(project, zone string) *compute.Disk

func (*DiskConfig) MountPoint

func (c *DiskConfig) MountPoint(root string) string

func (*DiskConfig) Validate

func (c *DiskConfig) Validate() error

type DiskProvider

type DiskProvider interface {
	Create(c *DiskConfig) error
	Attach(c *DiskConfig) error
	Detach(c *DiskConfig) error
	Delete(c *DiskConfig) error
	List() ([]*compute.Disk, error)
}

type Network

type Network struct {
	Client
}

func NewNetwork

func NewNetwork(c *http.Client, project, zone, instance string) (*Network, error)

func (*Network) Create

func (n *Network) Create(c *NetworkConfig) error

func (*Network) Delete

func (n *Network) Delete(c *NetworkConfig) error

type NetworkConfig

type NetworkConfig struct {
	GroupName string
	Container string
	Network   string
	Address   string
	Ports     []docker.Port
	Source    struct {
		Ranges []string
		Tags   []string
	}
	SessionAffinity SessionAffinity
}

func (*NetworkConfig) Firewall

func (c *NetworkConfig) Firewall(instance string) *compute.Firewall

func (*NetworkConfig) ForwardingRule

func (c *NetworkConfig) ForwardingRule(instance, targetPoolURL string) []*compute.ForwardingRule

func (*NetworkConfig) Group

func (c *NetworkConfig) Group(instance string) string

func (*NetworkConfig) ID

func (c *NetworkConfig) ID(instance string) string

func (*NetworkConfig) Name

func (c *NetworkConfig) Name(instance string) string

func (*NetworkConfig) TargetPool

func (c *NetworkConfig) TargetPool(project, zone, instance string) *compute.TargetPool

func (*NetworkConfig) Validate

func (c *NetworkConfig) Validate() error

type NetworkProvider

type NetworkProvider interface {
	Create(c *DiskConfig) error
	Delete(c *DiskConfig) error
}

type SessionAffinity

type SessionAffinity string

Jump to

Keyboard shortcuts

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