digitalocean

package
v0.5.2 Latest Latest
Warning

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

Go to latest
Published: Dec 8, 2018 License: Apache-2.0 Imports: 13 Imported by: 0

Documentation

Index

Constants

View Source
const (
	DRIVER_NAME        = "digitalocean"
	DRIVER_CONFIG_FILE = "digitalocean.cfg"

	VOLUME_CFG_PREFIX = "volume_"
	CFG_PREFIX        = DRIVER_NAME + "_"
	CFG_SUFFIX        = ".json"

	DO_DEFAULT_VOLUME_SIZE = "do.defaultvolumesize"
	DEFAULT_VOLUME_SIZE    = "10G"

	DO_DEVICE_FOLDER = "/dev/disk/by-id"
	DO_DEVICE_PREFIX = "scsi-0DO_Volume_"
	DO_VOLUME_FS     = "ext4"

	MOUNTS_DIR = "mounts"

	GB = 1073741824
)

Variables

This section is empty.

Functions

func Init

func Init(root string, config map[string]string) (ConvoyDriver, error)

Types

type Client

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

func NewClient

func NewClient() (*Client, error)

func (*Client) AttachVolume

func (c *Client) AttachVolume(id string) error

func (*Client) CreateVolume

func (c *Client) CreateVolume(name string, size int64) (string, error)

func (*Client) DeleteVolume

func (c *Client) DeleteVolume(name string) error

func (*Client) DetachVolume

func (c *Client) DetachVolume(id string) error

func (*Client) GetVolume

func (c *Client) GetVolume(id string) (*godo.Volume, error)

type Device

type Device struct {
	Root              string
	DefaultVolumeSize int64
}

func (*Device) ConfigFile

func (d *Device) ConfigFile() (string, error)

type Driver

type Driver struct {
	Device
	// contains filtered or unexported fields
}

Driver is a convoy driver for DigitalOcean volumes

func (*Driver) BackupOps

func (d *Driver) BackupOps() (BackupOperations, error)

func (*Driver) CreateVolume

func (d *Driver) CreateVolume(req Request) error

func (*Driver) DeleteVolume

func (d *Driver) DeleteVolume(req Request) error

func (*Driver) GetVolumeInfo

func (d *Driver) GetVolumeInfo(name string) (map[string]string, error)

func (*Driver) Info

func (d *Driver) Info() (map[string]string, error)

func (*Driver) ListVolume

func (d *Driver) ListVolume(opts map[string]string) (map[string]map[string]string, error)

func (*Driver) MountPoint

func (d *Driver) MountPoint(req Request) (string, error)

func (*Driver) MountVolume

func (d *Driver) MountVolume(req Request) (string, error)

func (*Driver) Name

func (d *Driver) Name() string

func (*Driver) SnapshotOps

func (d *Driver) SnapshotOps() (SnapshotOperations, error)

These methods are not implemented currently at DigitalOcean

func (*Driver) UmountVolume

func (d *Driver) UmountVolume(req Request) error

func (*Driver) VolumeOps

func (d *Driver) VolumeOps() (VolumeOperations, error)

type TokenAuth

type TokenAuth struct {
	AuthToken string
}

func (*TokenAuth) Token

func (t *TokenAuth) Token() (*oauth2.Token, error)

type Volume

type Volume struct {
	Name       string
	ID         string
	Device     string
	MountPoint string
	Size       int64
	// contains filtered or unexported fields
}

func (*Volume) ConfigFile

func (v *Volume) ConfigFile() (string, error)

func (*Volume) GenerateDefaultMountPoint

func (v *Volume) GenerateDefaultMountPoint() string

func (*Volume) GetDevice

func (v *Volume) GetDevice() (string, error)

func (*Volume) GetMountOpts

func (v *Volume) GetMountOpts() []string

Jump to

Keyboard shortcuts

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