gs

package
v0.50.0 Latest Latest
Warning

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

Go to latest
Published: Sep 5, 2021 License: Apache-2.0 Imports: 18 Imported by: 0

Documentation

Index

Constants

View Source
const (
	StreamingSha256          = "STREAMING-AWS4-HMAC-SHA256-PAYLOAD"
	StreamingContentEncoding = "aws-chunked"
)
View Source
const (
	MaxMultipartObjects = 10000
)
View Source
const MaxPartsInCompose = 32

Variables

View Source
var (
	ErrNotImplemented      = errors.New("not implemented")
	ErrMissingPartNumber   = errors.New("missing part number")
	ErrMissingPartETag     = errors.New("missing part ETag")
	ErrMismatchPartETag    = errors.New("mismatch part ETag")
	ErrMismatchPartName    = errors.New("mismatch part name")
	ErrMaxMultipartObjects = errors.New("maximum multipart object reached")
	ErrPartListMismatch    = errors.New("multipart part list mismatch")
	ErrMissingTargetAttrs  = errors.New("missing target attributes")
)
View Source
var ErrReaderTimeout = errors.New("reader timeout")

Functions

func ComposeAll

func ComposeAll(target string, parts []string, composeFunc ComposeFunc) error

func ReadAllWithTimeout

func ReadAllWithTimeout(r io.Reader, buf []byte, timeout time.Duration) (n int, err error)

ReadAllWithTimeout is taken from io.ReadAtLeast and adapted to support a timeout

func WithTranslator

func WithTranslator(t block.UploadIDTranslator) func(a *Adapter)

Types

type Adapter

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

func NewAdapter

func NewAdapter(client *storage.Client, opts ...func(a *Adapter)) *Adapter

func (*Adapter) AbortMultiPartUpload

func (a *Adapter) AbortMultiPartUpload(ctx context.Context, obj block.ObjectPointer, uploadID string) error

func (*Adapter) BlockstoreType

func (a *Adapter) BlockstoreType() string

func (*Adapter) Close

func (a *Adapter) Close() error

func (*Adapter) CompleteMultiPartUpload

func (a *Adapter) CompleteMultiPartUpload(ctx context.Context, obj block.ObjectPointer, uploadID string, multipartList *block.MultipartUploadCompletion) (*string, int64, error)

func (*Adapter) Copy

func (a *Adapter) Copy(ctx context.Context, sourceObj, destinationObj block.ObjectPointer) error

func (*Adapter) CreateMultiPartUpload

func (a *Adapter) CreateMultiPartUpload(ctx context.Context, obj block.ObjectPointer, r *http.Request, opts block.CreateMultiPartUploadOpts) (string, error)

func (*Adapter) Exists

func (a *Adapter) Exists(ctx context.Context, obj block.ObjectPointer) (bool, error)

func (*Adapter) GenerateInventory

func (a *Adapter) GenerateInventory(_ context.Context, _ logging.Logger, _ string, _ bool, _ []string) (block.Inventory, error)

func (*Adapter) Get

func (*Adapter) GetProperties

func (a *Adapter) GetProperties(ctx context.Context, obj block.ObjectPointer) (block.Properties, error)

func (*Adapter) GetRange

func (a *Adapter) GetRange(ctx context.Context, obj block.ObjectPointer, startPosition int64, endPosition int64) (io.ReadCloser, error)

func (*Adapter) GetStorageNamespaceInfo

func (a *Adapter) GetStorageNamespaceInfo() block.StorageNamespaceInfo

func (*Adapter) Put

func (a *Adapter) Put(ctx context.Context, obj block.ObjectPointer, sizeBytes int64, reader io.Reader, _ block.PutOpts) error

func (*Adapter) Remove

func (a *Adapter) Remove(ctx context.Context, obj block.ObjectPointer) error

func (*Adapter) RuntimeStats added in v0.41.1

func (a *Adapter) RuntimeStats() map[string]string

func (*Adapter) UploadCopyPart

func (a *Adapter) UploadCopyPart(ctx context.Context, sourceObj, destinationObj block.ObjectPointer, uploadID string, partNumber int64) (string, error)

func (*Adapter) UploadCopyPartRange

func (a *Adapter) UploadCopyPartRange(ctx context.Context, sourceObj, destinationObj block.ObjectPointer, uploadID string, partNumber, startPosition, endPosition int64) (string, error)

func (*Adapter) UploadPart

func (a *Adapter) UploadPart(ctx context.Context, obj block.ObjectPointer, sizeBytes int64, reader io.Reader, uploadID string, partNumber int64) (string, error)

func (*Adapter) ValidateConfiguration

func (a *Adapter) ValidateConfiguration(ctx context.Context, _ string) error

func (*Adapter) Walk

func (a *Adapter) Walk(ctx context.Context, walkOpt block.WalkOpts, walkFn block.WalkFunc) error

type ComposeFunc

type ComposeFunc func(target string, parts []string) error

type StreamingReader

type StreamingReader struct {
	Reader       io.Reader
	Size         int
	StreamSigner *v4.StreamSigner
	Time         time.Time
	ChunkSize    int
	ChunkTimeout time.Duration
	// contains filtered or unexported fields
}

func (*StreamingReader) GetLastChunk

func (s *StreamingReader) GetLastChunk() []byte

func (*StreamingReader) Read

func (s *StreamingReader) Read(p []byte) (int, error)

Jump to

Keyboard shortcuts

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