storage

package
v0.0.0-...-2ef4a2e Latest Latest
Warning

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

Go to latest
Published: May 27, 2023 License: MIT Imports: 7 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type ObjectStorage

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

func NewObjectStorage

func NewObjectStorage(config *ObjectStorageConfig) *ObjectStorage

func (*ObjectStorage) CompareAndSwap

func (s *ObjectStorage) CompareAndSwap(ctx context.Context, objectPath string, newValue io.Reader, newLength int64, oldEtag string) (string, error)

CompareAndSwap try to compare and swap in best effort fashion Known limitations: - S3 does not provide `if-match: etag` for PutObject

func (*ObjectStorage) Get

func (s *ObjectStorage) Get(ctx context.Context, objectPath string, etag string) (io.Reader, error)

func (*ObjectStorage) GetEtag

func (s *ObjectStorage) GetEtag(ctx context.Context, objectPath string) (string, error)

func (*ObjectStorage) GetObject

func (s *ObjectStorage) GetObject(ctx context.Context, objectPath string) ([]byte, error)

func (*ObjectStorage) MakeBucket

func (s *ObjectStorage) MakeBucket(ctx context.Context, bucketName string) error

func (*ObjectStorage) PutObject

func (s *ObjectStorage) PutObject(ctx context.Context, objectPath string, value []byte) error

type ObjectStorageConfig

type ObjectStorageConfig struct {
	Endpoint        string
	AccessKeyID     string
	SecretAccessKey string
	UseSSL          bool
	Bucket          string
	PathPrefix      string
}

Jump to

Keyboard shortcuts

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