Documentation
¶
Index ¶
- Constants
- func CalcDigest(obj Object, downloadRangeSize int64, algorithm string) ([]byte, error)
- func DisallowIAMFallback(awsSession *session.Session) (*session.Session, error)
- func Download(obj Object, rangeSize int64, out io.Writer) (n int64, err error)
- func EnsureS3Region(region string, endpoint *url.URL) string
- func InitS3Session(endpointP *string, regionStrP *string) (*session.Session, error)
- func IsEC2() (bool, error)
- func RegionFromEndpoint(endpoint *url.URL) (*string, error)
- func ValidS3Session(endpointP *string, regionStrP *string) (awsSession *session.Session, err error)
- type Object
- type S3Logger
- type S3Object
- func (obj *S3Object) ContentLength() (length int64, err error)
- func (obj *S3Object) Create(body io.Reader, length int64) (err error)
- func (obj *S3Object) Delete() (err error)
- func (obj *S3Object) DownloadRange(startInclusive, endInclusive int64, buffer []byte) (n int64, err error)
- func (obj *S3Object) Get() (h *s3.GetObjectOutput, err error)
- func (obj *S3Object) GetEndpoint() Target
- func (obj *S3Object) Head() (h *s3.HeadObjectOutput, err error)
- func (obj *S3Object) Pretty() string
- func (obj *S3Object) String() string
- func (obj *S3Object) SupportsRanges() bool
- type S3Target
- type SwiftObject
- func (obj *SwiftObject) ContentLength() (length int64, err error)
- func (obj *SwiftObject) Create(body io.Reader, length int64) (err error)
- func (obj *SwiftObject) Delete() (err error)
- func (obj *SwiftObject) DownloadRange(startInclusive, endInclusive int64, buffer []byte) (n int64, err error)
- func (obj *SwiftObject) GetEndpoint() Target
- func (obj *SwiftObject) Pretty() string
- func (obj *SwiftObject) String() string
- type SwiftTarget
- type Target
Constants ¶
const ( SwiftUserEnvVar = "ST_USER" SwiftKeyEnvVar = "ST_KEY" )
const (
// DefaultAwsRegion represents the default AWS region for accessing AWS objects
DefaultAwsRegion = "us-west-2"
)
Variables ¶
This section is empty.
Functions ¶
func CalcDigest ¶
CalcDigest calculates the digest of the object using the specified algorithm (md5 or sha256), using ranged downloads of the specified size.
func DisallowIAMFallback ¶
DisallowIAMFallback uses reflection to check whether we're falling back to IAM credentials See https://github.com/aws/aws-sdk-go/issues/2392
func Download ¶
Download downloads the object in chunks of the specified rangeSize, writing the downloaded bytes to the specified io.Writer.
func InitS3Session ¶
InitS3Session returns a new AWS session configured for S3 access via the specified endpoint and region. The verboseLogging parameter controls whether to return verbose error messages.
func RegionFromEndpoint ¶
RegionFromEndpoint attempts to extract an AWS region from the specified endpoint URL, returning an error if none can be found.
Types ¶
type Object ¶
type S3Object ¶
func (*S3Object) ContentLength ¶
func (*S3Object) DownloadRange ¶
func (*S3Object) GetEndpoint ¶
func (*S3Object) SupportsRanges ¶
SupportsRanges returns true if the object supports ranged downloads, false otherwise
type S3Target ¶
type SwiftObject ¶
type SwiftObject struct { Endpoint *SwiftTarget Container string Name string }
func (*SwiftObject) ContentLength ¶
func (obj *SwiftObject) ContentLength() (length int64, err error)
func (*SwiftObject) Create ¶
func (obj *SwiftObject) Create(body io.Reader, length int64) (err error)
func (*SwiftObject) Delete ¶
func (obj *SwiftObject) Delete() (err error)
func (*SwiftObject) DownloadRange ¶
func (obj *SwiftObject) DownloadRange(startInclusive, endInclusive int64, buffer []byte) (n int64, err error)
func (*SwiftObject) GetEndpoint ¶
func (obj *SwiftObject) GetEndpoint() Target
func (*SwiftObject) Pretty ¶
func (obj *SwiftObject) Pretty() string
func (*SwiftObject) String ¶
func (obj *SwiftObject) String() string
type SwiftTarget ¶
type SwiftTarget struct { UserName string APIKey string AuthURL *url.URL Container string // contains filtered or unexported fields }
func NewSwiftEndpoint ¶
func NewSwiftEndpoint(endpointUrl *url.URL, container string) (*SwiftTarget, error)
func (*SwiftTarget) Connection ¶
func (e *SwiftTarget) Connection() (*swift.Connection, error)
func (*SwiftTarget) Object ¶
func (e *SwiftTarget) Object(key string) Object
func (*SwiftTarget) Pretty ¶
func (e *SwiftTarget) Pretty() string
func (*SwiftTarget) String ¶
func (e *SwiftTarget) String() string