multipart

package
v1.11.6 Latest Latest
Warning

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

Go to latest
Published: Aug 8, 2023 License: MIT Imports: 16 Imported by: 0

Documentation

Index

Constants

View Source
const (
	DefaultPartSize       = 5 * libsiz.SizeMega
	MaxPartSize           = 5 * libsiz.SizeGiga
	MaxObjectSize         = 5 * libsiz.SizeTera
	MaxNumberPart   int32 = 10000
)

Variables

View Source
var (
	ErrInvalidInstance           = fmt.Errorf("invalid instance")
	ErrInvalidClient             = fmt.Errorf("invalid aws S3 client")
	ErrInvalidResponse           = fmt.Errorf("invalid aws S3 response")
	ErrInvalidUploadID           = fmt.Errorf("invalid aws s3 MPU Upload ID")
	ErrInvalidTMPFile            = fmt.Errorf("invalid working or temporary file")
	ErrWorkingPartFileExceedSize = fmt.Errorf("working or temporary file used exceed the aws S3 size limits")
)

Functions

func GetOptimalPartSize

func GetOptimalPartSize(objectSize, partSize libsiz.Size) (libsiz.Size, error)

Types

type FuncClientS3

type FuncClientS3 func() *sdksss.Client

type MultiPart

type MultiPart interface {
	io.WriteCloser

	RegisterContext(fct libctx.FuncContext)
	RegisterClientS3(fct FuncClientS3)
	RegisterMultipartID(id string)
	RegisterWorkingFile(file string, truncate bool) error
	RegisterFuncOnPushPart(fct func(eTag string, e error))
	RegisterFuncOnAbort(fct func(nPart int, obj string, e error))
	RegisterFuncOnComplete(fct func(nPart int, obj string, e error))

	StartMPU() error
	StopMPU(abort bool) error

	AddPart(r io.Reader) (n int64, e error)
	SendPart() error
	CurrentSizePart() int64
	AddToPart(p []byte) (n int, e error)
	RegisterPart(etag string)

	IsStarted() bool
	Counter() int32
	CounterLeft() int32
}

func New

func New(partSize libsiz.Size, object string, bucket string) MultiPart

Jump to

Keyboard shortcuts

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