uploaders

package
v0.1.0-M4 Latest Latest
Warning

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

Go to latest
Published: Aug 10, 2023 License: Apache-2.0, EPL-2.0 Imports: 22 Imported by: 1

Documentation

Index

Constants

View Source
const (
	StorageProviderAWS = "aws"

	AWSRegion          = "aws.region"
	AWSAccessKeyID     = "aws.access.key.id"
	AWSSecretAccessKey = "aws.secret.access.key"
	AWSSessionToken    = "aws.session.token"
	AWSBucket          = "aws.s3.bucket"
	AWSObjectKey       = "aws.object.key"
)

Constants for AWS upload 'start' operation options

View Source
const (
	StorageProviderAzure = "azure"

	AzureEndpoint      = "azure.storage.endpoint"
	AzureSAS           = "azure.shared.access.signature"
	AzureContainerName = "azure.blob.container"
)

Constants for Azure upload 'start' operation options

View Source
const (
	StorageProviderHTTP = "generic"

	URLProp       = "https.url"
	MethodProp    = "https.method"
	HeadersPrefix = "https.header."
)

Constants for HTTP(S) file upload 'start' operation options

View Source
const ContentMD5 = "Content-MD5"

ContentMD5 header name

Variables

This section is empty.

Functions

func ComputeMD5

func ComputeMD5(f *os.File, encodeBase64 bool) (string, error)

ComputeMD5 returns the MD5 hash of a file, which can be encoded as base64 string.

func ExtractDictionary

func ExtractDictionary(options map[string]string, prefix string) map[string]string

ExtractDictionary extracts from the given map properties with a specified prefix. In the resulting dictionary, property names have the prefix removed.

func SupportedCipherSuites

func SupportedCipherSuites() []uint16

SupportedCipherSuites returns the ids of secure TLS cipher suites

Types

type AWSUploader

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

AWSUploader handles upload to AWS S3 storage

func (*AWSUploader) UploadFile

func (u *AWSUploader) UploadFile(file *os.File, useChecksum bool, listener func(bytesTransferred int64)) error

UploadFile performs AWS S3 file upload

type AzureUploader

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

AzureUploader handles upload to Azure Blob storage

func (*AzureUploader) UploadFile

func (u *AzureUploader) UploadFile(file *os.File, useChecksum bool, listener func(bytesTransferred int64)) error

UploadFile performs Azure file upload

type HTTPUploader

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

HTTPUploader handles generic HTTP uploads

func (*HTTPUploader) UploadFile

func (u *HTTPUploader) UploadFile(file *os.File, useChecksum bool, listener func(bytesTransferred int64)) error

UploadFile performs generic HTTP file upload

type Uploader

type Uploader interface {
	UploadFile(file *os.File, useChecksum bool, listener func(bytesTransferred int64)) error
}

Uploader interface wraps the generic UploadFile method

func NewAWSUploader

func NewAWSUploader(options map[string]string) (Uploader, error)

NewAWSUploader construct new AWSUploader from the provided 'start' operation options

func NewAzureUploader

func NewAzureUploader(options map[string]string) (Uploader, error)

NewAzureUploader constructs new AzureUploader from provided 'start' operation options

func NewHTTPUploader

func NewHTTPUploader(options map[string]string, serverCert string) (Uploader, error)

NewHTTPUploader construct new HttpUploader from the provided 'start' operation options

Jump to

Keyboard shortcuts

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