uploader

package
v0.9.1 Latest Latest
Warning

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

Go to latest
Published: Oct 17, 2022 License: MIT Imports: 13 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

View Source
var (
	ProviderBackBlaze    = Provider{"BackBlazeB2", regexp.MustCompile(`.*backblazeb2\.com\/?$`), "{{.EndpointURL.Scheme}}://{{.Bucket}}.{{.EndpointURL.Host}}/{{.Object}}"}
	ProviderSkiverPublic = Provider{"B2 Skiver", nil, "https://b2p.runar.dev/file/{{.Bucket}}/{{.Object}}"}
)

Functions

func NewS3Uplaoder

func NewS3Uplaoder(
	l logger.AppLogger,
	Identifier string,
	options S3UploaderOptions,
	privateKey string,

) *s3Uploader

Types

type AddFileOptions added in v0.8.4

type AddFileOptions struct {
	Metadata map[string]*string
}

type FileUploader

type FileUploader interface {
	AddPublicFile(key string, r io.ReadSeeker, size int64, contentType string, contentDisposition string, options ...AddFileOptions) (types.UploadMeta, error)
	AddPublicFileWithAliases(keys []string, r io.ReadSeeker, size int64, contentType string, contentDisposition string, options ...AddFileOptions) ([]types.UploadMeta, error)
	UrlForFile(objectID string) (string, error)
	Identifier() string
	HeadFile(key string) (*s3.HeadObjectOutput, error)
	GetFile(key string) (*s3.GetObjectOutput, error)
}

type Provider

type Provider struct {
	Name string

	UrlFormat string
	// contains filtered or unexported fields
}

func (Provider) String

func (p Provider) String() string

type S3UploaderOptions

type S3UploaderOptions struct {
	Endpoint,
	Region,
	Bucket,
	ProviderName,
	AccessKey string
	ForcePathStyle bool
	UrlFormat      string
	CacheControl   string
}

Jump to

Keyboard shortcuts

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