s3

package
v1.0.8-beta.1 Latest Latest
Warning

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

Go to latest
Published: Jun 28, 2024 License: MIT Imports: 14 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func New

func New(b Bus, w Worker, logger *zap.SugaredLogger, opts Opts) (http.Handler, error)

func Parsev4AuthKeys

func Parsev4AuthKeys(keyPairs []string) (map[string]string, error)

Parsev4AuthKeys parses a list of accessKey-secretKey pairs and returns a map

Types

type Bus

type Bus interface {
	Bucket(ctx context.Context, bucketName string) (api.Bucket, error)
	CreateBucket(ctx context.Context, bucketName string, opts api.CreateBucketOptions) error
	DeleteBucket(ctx context.Context, bucketName string) error
	ListBuckets(ctx context.Context) (buckets []api.Bucket, err error)

	AddObject(ctx context.Context, bucket, path, contractSet string, o object.Object, opts api.AddObjectOptions) (err error)
	CopyObject(ctx context.Context, srcBucket, dstBucket, srcPath, dstPath string, opts api.CopyObjectOptions) (om api.ObjectMetadata, err error)
	DeleteObject(ctx context.Context, bucket, path string, opts api.DeleteObjectOptions) (err error)
	ListObjects(ctx context.Context, bucket string, opts api.ListObjectOptions) (resp api.ObjectsListResponse, err error)
	Object(ctx context.Context, bucket, path string, opts api.GetObjectOptions) (res api.ObjectsResponse, err error)

	AbortMultipartUpload(ctx context.Context, bucket, path string, uploadID string) (err error)
	CompleteMultipartUpload(ctx context.Context, bucket, path, uploadID string, parts []api.MultipartCompletedPart, opts api.CompleteMultipartOptions) (_ api.MultipartCompleteResponse, err error)
	CreateMultipartUpload(ctx context.Context, bucket, path string, opts api.CreateMultipartOptions) (api.MultipartCreateResponse, error)
	MultipartUploads(ctx context.Context, bucket, prefix, keyMarker, uploadIDMarker string, maxUploads int) (resp api.MultipartListUploadsResponse, _ error)
	MultipartUploadParts(ctx context.Context, bucket, object string, uploadID string, marker int, limit int64) (resp api.MultipartListPartsResponse, _ error)

	S3AuthenticationSettings(ctx context.Context) (as api.S3AuthenticationSettings, err error)
	UpdateSetting(ctx context.Context, key string, value interface{}) error
	UploadParams(ctx context.Context) (api.UploadParams, error)
}

type Opts

type Opts struct {
	AuthDisabled      bool
	HostBucketEnabled bool
	HostBucketBases   []string
}

type Worker

type Worker interface {
	GetObject(ctx context.Context, bucket, path string, opts api.DownloadObjectOptions) (*api.GetObjectResponse, error)
	HeadObject(ctx context.Context, bucket, path string, opts api.HeadObjectOptions) (*api.HeadObjectResponse, error)
	UploadObject(ctx context.Context, r io.Reader, bucket, path string, opts api.UploadObjectOptions) (*api.UploadObjectResponse, error)
	UploadMultipartUploadPart(ctx context.Context, r io.Reader, bucket, path, uploadID string, partNumber int, opts api.UploadMultipartUploadPartOptions) (*api.UploadMultipartUploadPartResponse, error)
}

Jump to

Keyboard shortcuts

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