Documentation ¶
Index ¶
- Variables
- func AlertError(alertingConfig *AlertingConfig, message string, err error)
- func AlertMessage(alertingConfig *AlertingConfig, message string)
- func CreateVolume(createRequest *godo.VolumeCreateRequest, ...) (*godo.Volume, error)
- func DestroyVolume(volumeID string, digitalOceanClient *DigitalOceanClient) error
- func DirSize(path string) (int64, error)
- func DownloadFileFromBucket() error
- func FileOrDirSize(path string) (int64, error)
- func FindVolume(id string, digitalOceanClient *DigitalOceanClient) (*godo.Volume, error)
- func GetRunningInstanceData() (*metadata.Metadata, error)
- func MountVolume(volumeName string, mountPoint string, volumeID string, dropletID int, ...) error
- func ParseCommandLineFlags(args []string) error
- func PerformCommand(cmdArgs ...string) (string, error)
- func PerformCommandWithFileOutput(outputFilename string, cmd string, cmdArgs ...string) error
- func ReportProgressOnCopy(source string, destination string, doneChan chan bool)
- func ReportProgressOnFileSize(location string, expectedSize int64, doneChan chan bool)
- func UnmountVolume(mountPoint string, volumeID string, dropletID int, ...) error
- func UploadFileToBucket(bucketName string, objectName string, filePath string, ...) error
- func WithRetry(tag string, runner func() error) error
- type AlertingConfig
- type DigitalOceanClient
Constants ¶
This section is empty.
Variables ¶
var ErrorLog *log.Logger
ErrorLog is the default error log to use
var Log *log.Logger
Log is the default log to use
var VerboseMode bool
VerboseMode is a global switch to turn verbose mode off or on
Functions ¶
func AlertError ¶
func AlertError(alertingConfig *AlertingConfig, message string, err error)
AlertError alerts an error to the system administrator
func AlertMessage ¶
func AlertMessage(alertingConfig *AlertingConfig, message string)
AlertMessage simply alerts a message to the correct channels
func CreateVolume ¶
func CreateVolume(createRequest *godo.VolumeCreateRequest, digitalOceanClient *DigitalOceanClient) (*godo.Volume, error)
CreateVolume creates a DigitalOcean volume
func DestroyVolume ¶
func DestroyVolume(volumeID string, digitalOceanClient *DigitalOceanClient) error
DestroyVolume destroys a volume
func DownloadFileFromBucket ¶
func DownloadFileFromBucket() error
DownloadFileFromBucket downloads a file
func FileOrDirSize ¶
FileOrDirSize gets the size of a directory or file
func FindVolume ¶
func FindVolume(id string, digitalOceanClient *DigitalOceanClient) (*godo.Volume, error)
FindVolume finds a DigitalOcean volume by ID
func GetRunningInstanceData ¶
func GetRunningInstanceData() (*metadata.Metadata, error)
GetRunningInstanceData returns current droplets data
func MountVolume ¶
func MountVolume(volumeName string, mountPoint string, volumeID string, dropletID int, digitalOceanClient *DigitalOceanClient) error
MountVolume mounts volume on machine and won't return until complete
func ParseCommandLineFlags ¶
ParseCommandLineFlags parsed flags defined by `flag` package. Required to work with sub-commands
func PerformCommand ¶
PerformCommand performs a command line command with nice helpers
func PerformCommandWithFileOutput ¶
PerformCommandWithFileOutput performs a command with output to a file
func ReportProgressOnCopy ¶
ReportProgressOnCopy will start printing the size of a file/directory in relation to another file/directory If source file/directory does not exist it will return immediately
func ReportProgressOnFileSize ¶
ReportProgressOnFileSize will start printing the size of a file in relation to what the expected size is
func UnmountVolume ¶
func UnmountVolume(mountPoint string, volumeID string, dropletID int, digitalOceanClient *DigitalOceanClient) error
UnmountVolume unmounts a volume
Types ¶
type AlertingConfig ¶
type AlertingConfig struct {
Slack *alerting.SlackConfig `json:"slack"`
}
AlertingConfig sub-config type for alerting related
type DigitalOceanClient ¶
DigitalOceanClient is a wrapper to be able to make calls to the DigitalOcean API
func NewDigitalOceanClient ¶
func NewDigitalOceanClient(accessToken string) *DigitalOceanClient
NewDigitalOceanClient creates a client