bosutil

package
v0.0.0-...-05ce33d Latest Latest
Warning

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

Go to latest
Published: Aug 31, 2022 License: Apache-2.0 Imports: 8 Imported by: 0

Documentation

Index

Constants

View Source
const (
	// DEFAULT_SERVICE_DOMAIN = bce.DEFAULT_REGION + ".bcebos.com"
	DEFAULT_MAX_PARALLEL   = 10
	MULTIPART_ALIGN        = 1 << 20         // 1MB
	MIN_MULTIPART_SIZE     = 100 * (1 << 10) // 100 KB
	DEFAULT_MULTIPART_SIZE = 12 * (1 << 20)  // 12MB

	MAX_PART_NUMBER        = 10000
	MAX_SINGLE_PART_SIZE   = 5 * (1 << 30)    // 5GB
	MAX_SINGLE_OBJECT_SIZE = 48.8 * (1 << 40) // 48.8TB
)

Variables

This section is empty.

Functions

This section is empty.

Types

type SimpleUploader

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

func CreateSimpleUploader

func CreateSimpleUploader(c *bos.Client, reader io.Reader, fileSize int64, encryptFunction func(data []byte) []byte, concurrent int) *SimpleUploader

func (*SimpleUploader) FileSize

func (uploader *SimpleUploader) FileSize() int64

func (*SimpleUploader) ParallelUpload

func (uploader *SimpleUploader) ParallelUpload(bucket string, object string, contentType string, args *api.InitiateMultipartUploadArgs) (*api.CompleteMultipartUploadResult, error)

func (*SimpleUploader) SimplelUpload

func (uploader *SimpleUploader) SimplelUpload(bucket string, object string, contentType string, args *api.InitiateMultipartUploadArgs) (*api.CompleteMultipartUploadResult, error)

ParallelUpload - auto multipart upload object

PARAMS:

  • bucket: the bucket name
  • object: the object name
  • filename: the filename
  • contentType: the content type default(application/octet-stream)
  • args: the bucket name nil using default

RETURNS:

  • *api.CompleteMultipartUploadResult: multipart upload result
  • error: nil if success otherwise the specific error

func (*SimpleUploader) SumCrc32

func (uploader *SimpleUploader) SumCrc32() uint32

Jump to

Keyboard shortcuts

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