iaas

package
Version: v0.0.0-...-96bdf66 Latest Latest
Warning

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

Go to latest
Published: Sep 22, 2017 License: Apache-2.0 Imports: 13 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type AWSClient

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

AWSClient is the concrete implementation of IClient on AWS

func (*AWSClient) DeleteFile

func (client *AWSClient) DeleteFile(bucket, path string) error

DeleteFile deletes a file from S3

func (*AWSClient) DeleteVMsInVPC

func (client *AWSClient) DeleteVMsInVPC(vpcID string) error

DeleteVMsInVPC deletes all the VMs in the given VPC

func (*AWSClient) DeleteVersionedBucket

func (client *AWSClient) DeleteVersionedBucket(name string) error

DeleteVersionedBucket deletes and empties a versioned bucket

func (*AWSClient) EnsureBucketExists

func (client *AWSClient) EnsureBucketExists(name string) error

EnsureBucketExists checks if the named bucket exists and creates it if it doesn't

func (*AWSClient) EnsureFileExists

func (client *AWSClient) EnsureFileExists(bucket, path string, defaultContents []byte) ([]byte, bool, error)

EnsureFileExists checks for the named file in S3 and creates it if it doesn't Second argument is true if new file was created

func (*AWSClient) FindLongestMatchingHostedZone

func (client *AWSClient) FindLongestMatchingHostedZone(subdomain string) (string, string, error)

FindLongestMatchingHostedZone finds the longest hosted zone that matches the given subdomain

func (*AWSClient) HasFile

func (client *AWSClient) HasFile(bucket, path string) (bool, error)

HasFile returns true if the specified S3 object exists

func (*AWSClient) IAAS

func (client *AWSClient) IAAS() string

IAAS returns the iaas to operate against

func (*AWSClient) LoadFile

func (client *AWSClient) LoadFile(bucket, path string) ([]byte, error)

LoadFile loads a file from S3

func (*AWSClient) Region

func (client *AWSClient) Region() string

Region returns the region to operate against

func (*AWSClient) WriteFile

func (client *AWSClient) WriteFile(bucket, path string, contents []byte) error

WriteFile writes the specified S3 object

type IClient

type IClient interface {
	DeleteFile(bucket, path string) error
	DeleteVersionedBucket(name string) error
	DeleteVMsInVPC(vpcID string) error
	EnsureBucketExists(name string) error
	EnsureFileExists(bucket, path string, defaultContents []byte) ([]byte, bool, error)
	FindLongestMatchingHostedZone(subdomain string) (string, string, error)
	HasFile(bucket, path string) (bool, error)
	LoadFile(bucket, path string) ([]byte, error)
	WriteFile(bucket, path string, contents []byte) error
	Region() string
	IAAS() string
}

IClient represents actions taken against AWS

func New

func New(iaas string, region string) (IClient, error)

New returns a new IAAS client for a particular IAAS and region

Jump to

Keyboard shortcuts

? : This menu
/ : Search site
f or F : Jump to
t or T : Toggle theme light dark auto
y or Y : Canonical URL