bsw

package module
v0.0.2 Latest Latest
Warning

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

Go to latest
Published: Sep 25, 2023 License: MIT Imports: 2 Imported by: 0

README

bsw

Block storage wrapper (S3, Google drive, etc)

Documentation

Index

Constants

This section is empty.

Variables

View Source
var ErrWrongInvocation = errors.New("wrong invocation").Critical()

Functions

This section is empty.

Types

type BlockStorageWrapper

type BlockStorageWrapper interface {
	PreSignPutObjectURL(o *Object, timeout time.Duration) (string, error)
	PreSignMultipartObjectURL(o *Object, timeout time.Duration) (urls []string, uploadID string, err error)
	CompleteMultipartUpload(o *Object, uploadID string, parts []CompletedPart) error
	PreSignGetObjectURL(o *Object, timeout time.Duration) (string, error)
}

type CompletedPart

type CompletedPart interface {
	ETagPtr() *string
	PartNumberPtr() *int64
}

type Object

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

func NewMultipartObject

func NewMultipartObject(w BlockStorageWrapper, bucket, key string, parts int) *Object

func NewObject

func NewObject(w BlockStorageWrapper, bucket, key string) *Object

func (*Object) Bucket

func (o *Object) Bucket() string

func (*Object) Key

func (o *Object) Key() string

func (*Object) Metadata

func (o *Object) Metadata() map[string]*string

func (*Object) MultipartUploadURLs

func (o *Object) MultipartUploadURLs(timeout time.Duration) (urls []string, uploadID string, err error)

MultipartUploadURLs returns presigned URLs for PUT object request by parts. When all parts uploaded, call CompleteMultipartUpload to merge parts into a single file.

func (*Object) Parts

func (o *Object) Parts() int

func (*Object) ReplaceMetadata

func (o *Object) ReplaceMetadata(m map[string]*string) *Object

func (*Object) SetMetadata

func (o *Object) SetMetadata(key, value string) *Object

func (*Object) SetValidTill

func (o *Object) SetValidTill(t int64) *Object

func (*Object) StillValid

func (o *Object) StillValid() bool

func (*Object) UploadURL

func (o *Object) UploadURL(timeout time.Duration) (string, error)

UploadURL returns presigned URL for PUT object request.

Directories

Path Synopsis

Jump to

Keyboard shortcuts

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