objectstore

package
v0.0.0-...-b58e71a Latest Latest
Warning

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

Go to latest
Published: Jan 13, 2025 License: Apache-2.0 Imports: 8 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type Config

type Config struct {
	Endpoint        string
	AccessKeyID     string
	SecretAccessKey string
}

type ListObjectsOptions

type ListObjectsOptions minio.ListObjectsOptions

type MakeBucketOptions

type MakeBucketOptions minio.MakeBucketOptions

type ObjectStore

type ObjectStore struct {
	PresignedURLExpiration time.Duration
	// contains filtered or unexported fields
}

func New

func New(cfg Config) (*ObjectStore, error)

func (*ObjectStore) GetObject

func (ostore *ObjectStore) GetObject(ctx context.Context, bucketName, filename string) (*minio.Object, error)

GetObject gets object to be written

func (*ObjectStore) GetPresignedURLObject

func (ostore *ObjectStore) GetPresignedURLObject(ctx context.Context, bucketName, filename string, opts PresignedGetObjectOptions) (*url.URL, error)

PresignedGetObject gets presigned URL for object if presignedURLExpiration is not set defaults to a day

func (*ObjectStore) ListAllBucketsObjects

func (ostore *ObjectStore) ListAllBucketsObjects(ctx context.Context, opts ListObjectsOptions) ([]minio.ObjectInfo, error)

func (*ObjectStore) ListBuckets

func (ostore *ObjectStore) ListBuckets(ctx context.Context) ([]minio.BucketInfo, error)

func (*ObjectStore) ListObjects

func (ostore *ObjectStore) ListObjects(ctx context.Context, bucketName string, opts ListObjectsOptions) <-chan minio.ObjectInfo

func (*ObjectStore) MakeBucket

func (ostore *ObjectStore) MakeBucket(ctx context.Context, bucketName string, opts MakeBucketOptions) error

func (*ObjectStore) SaveObject

func (ostore *ObjectStore) SaveObject(ctx context.Context, bucketName, objectName string, reader io.Reader, objectSize int64, opts PutObjectOptions) (minio.UploadInfo, error)

SaveObject saves file from a reader interface to cloud if content type is not set this will try to detect and set what it detects

func (*ObjectStore) SaveObjectFromPath

func (ostore *ObjectStore) SaveObjectFromPath(ctx context.Context, bucketName, objectName, filePath string, opts PutObjectOptions) (minio.UploadInfo, error)

SaveObjectFromPath saves file from local disk to cloud if content type is not set this will try to detect and set what it detects

type PresignedGetObjectOptions

type PresignedGetObjectOptions struct {
	ReqParams              url.Values
	PresignedURLExpiration time.Duration
}

type PutObjectOptions

type PutObjectOptions minio.PutObjectOptions

Jump to

Keyboard shortcuts

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