volumes

package
v0.0.0-...-cad3fbd Latest Latest
Warning

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

Go to latest
Published: Jun 12, 2018 License: Apache-2.0 Imports: 3 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type ActionClient

type ActionClient interface {
	Attach(ctx context.Context, ip string, dropletID int) error
	DetachByDropletID(ctx context.Context, ip string, dropletID int) error
}

An ActionClient can interact with the DigitalOcean StorageAction service.

type Client

type Client interface {
	CreateVolume(ctx context.Context, name, region string, sizeGibiBytes int64, opts ...CreateOpt) (Volume, error)
	GetVolume(context.Context, string) (Volume, error)
	DeleteVolume(context.Context, string) error
	ListVolumes(context.Context) (<-chan Volume, <-chan error)

	CreateSnapshot(ctx context.Context, volumeID, name string, opts ...SnapshotOpt) (Snapshot, error)
	GetSnapshot(context.Context, string) (Snapshot, error)
	DeleteSnapshot(context.Context, string) error
	ListSnapshots(ctx context.Context, volumeID string) (<-chan Snapshot, <-chan error)

	Actions() ActionClient
}

A Client can interact with the DigitalOcean Volumes service.

func New

func New(g *godo.Client) Client

New creates a Client.

type CreateOpt

type CreateOpt func(*createOpt)

CreateOpt is an optional argument to Volumes.Create.

func SetVolumeDescription

func SetVolumeDescription(desc string) CreateOpt

SetVolumeDescription does what it says on the tin.

func SetVolumeFilesystemLabel

func SetVolumeFilesystemLabel(label string) CreateOpt

SetVolumeFilesystemLabel does what it says on the tin.

func SetVolumeFilesystemType

func SetVolumeFilesystemType(fs string) CreateOpt

SetVolumeFilesystemType does what it says on the tin.

type Snapshot

type Snapshot interface {
	Struct() *godo.Snapshot
}

A Snapshot in the DigitalOcean cloud.

type SnapshotOpt

type SnapshotOpt func(*snapshotOpt)

SnapshotOpt is an optional argument to Volumes.Edit.

func SetSnapshotDescription

func SetSnapshotDescription(desc string) SnapshotOpt

SetSnapshotDescription does what it says on the tin.

type Volume

type Volume interface {
	Struct() *godo.Volume
}

A Volume in the DigitalOcean cloud.

Jump to

Keyboard shortcuts

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