r2

package
v0.0.0-...-4181ed6 Latest Latest
Warning

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

Go to latest
Published: Jan 12, 2024 License: MIT, Apache-2.0 Imports: 27 Imported by: 0

Documentation

Overview

r2 package is inspired by a proposal in distribution/distribution repository, created by tpoxa Discussion: https://github.com/distribution/distribution/pull/3940 Revision: https://github.com/container-registry/distribution/tree/r2-multipart-issue License at revision: https://github.com/container-registry/distribution/blob/r2-multipart-issue/LICENSE

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type Driver

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

Driver is a storagedriver.StorageDriver implementation backed by Cloudflare's R2 Objects are stored at absolute keys in the provided bucket.

func FromParameters

func FromParameters(parameters map[string]interface{}) (*Driver, error)

FromParameters constructs a new Driver with a given parameters map Required parameters: - accesskey - secretkey - region - bucket - regionendpoint

func New

func New(params DriverParameters) (*Driver, error)

func (*Driver) S3BucketKey

func (d *Driver) S3BucketKey(path string) string

S3BucketKey returns the s3 bucket key for the given storage driver path.

type DriverParameters

type DriverParameters struct {
	AccessKey                   string
	SecretKey                   string
	Bucket                      string
	Region                      string
	RegionEndpoint              string
	ForcePathStyle              bool
	Secure                      bool
	SkipVerify                  bool
	ChunkSize                   int64
	MultipartCopyChunkSize      int64
	MultipartCopyMaxConcurrency int64
	MultipartCopyThresholdSize  int64
	RootDirectory               string
}

DriverParameters A struct that encapsulates all of the driver parameters after all values have been set

Jump to

Keyboard shortcuts

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