objectstore

package
v4.2.0+incompatible Latest Latest
Warning

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

Go to latest
Published: May 1, 2018 License: MIT Imports: 10 Imported by: 0

Documentation

Index

Constants

View Source
const DefaultObjectStoreTimeout = 360 * time.Second

DefaultObjectStoreTimeout is the timeout for ObjectStore PutObject api calls

Variables

This section is empty.

Functions

func IsGoogleCloudStorage

func IsGoogleCloudStorage(u *url.URL) bool

IsGoogleCloudStorage checks if the provided URL is from Google Cloud Storage service

Types

type Object

type Object struct {
	// PutURL is a presigned URL for PutObject
	PutURL string
	// DeleteURL is a presigned URL for RemoveObject
	DeleteURL string
	// contains filtered or unexported fields
}

Object represents an object on a S3 compatible Object Store service. It can be used as io.WriteCloser for uploading an object

func NewObject

func NewObject(ctx context.Context, putURL, deleteURL string, timeout time.Duration, size int64) (*Object, error)

NewObject opens an HTTP connection to Object Store and returns an Object pointer that can be used for uploading.

func (*Object) Close

func (o *Object) Close() error

Close implements the standard io.Closer interface: it closes the http client request. This method will also wait for the connection to terminate and return any error occurred during the upload

func (*Object) MD5

func (o *Object) MD5() string

MD5 returns the md5sum of the uploaded returned by the Object Store provider via ETag Header. This method will wait until upload context is done before returning.

func (*Object) Write

func (o *Object) Write(p []byte) (int, error)

Write implements the standard io.Writer interface: it writes data to the PutObject body.

type StatusCodeError

type StatusCodeError error

Directories

Path Synopsis

Jump to

Keyboard shortcuts

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