lib

package
v0.0.0-...-63d8d72 Latest Latest
Warning

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

Go to latest
Published: Jun 27, 2015 License: Apache-2.0 Imports: 7 Imported by: 0

Documentation

Overview

lib package contains core s3 functions for the cmdline executables - s3 location format parsers, basic file functions for removing, uploading, downloading and listing, etc.

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func CopyFromS3

func CopyFromS3(source, destination string) error

Download a file from an S3 location identified by "source", to a local file identified by "destination". Returns error if the source path is not in the proper format, if the source path is not readable with the current credentials, or if the destination is not writeable.

func CopyToS3

func CopyToS3(source string, destination string, isReducedRedundancy bool) error

Upload a file to an S3 location identified by "destination", from a local file identified by "source". Returns an error if the source file is not readable, if the destination s3 path is not writable, or if the destination path is not in the right format.

func IsS3Path

func IsS3Path(s string) bool

IsS3Path returns true if the string s is a valid s3 path, false otherwise

func RemoveS3Path

func RemoveS3Path(path string) error

RemoveS3Path removes an object in an S3 location specified in "path". Returns an error if the "path" is not a valid s3 path, or if the service failed to remove the object

Types

type S3path

type S3path struct {
	Bucket string
	Path   string
}

S3path is a struct representing the parts of the s3 path

func ParseS3Path

func ParseS3Path(path string) (*S3path, error)

ParseS3Path returns a struct of type S3path, from the string "path". Returns an error if the "path" is not a valid s3 path of the form "s3:bucket:/path/to/file"

Jump to

Keyboard shortcuts

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