storage

package
v0.0.0-...-d931726 Latest Latest
Warning

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

Go to latest
Published: Aug 28, 2024 License: MIT Imports: 6 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type File

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

File implements the Storage interface for a local file storage provider.

func (*File) BucketExists

func (f *File) BucketExists(name string) (bool, error)

func (*File) Connect

func (f *File) Connect(cfg config.Provider) (err error)

func (*File) CreateBucket

func (f *File) CreateBucket(name string, location ...string) error

func (*File) CreateBucketIfNotExists

func (f *File) CreateBucketIfNotExists(name string, location ...string) (err error)

func (*File) DeleteObject

func (f *File) DeleteObject(bucketName, objectName string) error

func (*File) GetObject

func (f *File) GetObject(bucketName string, objectName string) (io.ReadCloser, int64, error)

func (*File) PutObject

func (f *File) PutObject(bucketName string, objectName string, reader io.Reader, objectSize int64, mimeType string) (err error)

func (*File) Status

func (f *File) Status() error

type Minio

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

Minio implements the Storage interface for the MinIO SDK to connect to a MinIO instance, Amazon S3 or Google Cloud.

func (*Minio) BucketExists

func (m *Minio) BucketExists(name string) (bool, error)

func (*Minio) Connect

func (m *Minio) Connect(cfg config.Provider) (err error)

func (*Minio) CreateBucket

func (m *Minio) CreateBucket(name string, location ...string) error

func (*Minio) CreateBucketIfNotExists

func (m *Minio) CreateBucketIfNotExists(name string, location ...string) (err error)

func (*Minio) DeleteObject

func (m *Minio) DeleteObject(bucketName, objectName string) error

func (*Minio) GetObject

func (m *Minio) GetObject(bucketName, objectName string) (io.ReadCloser, int64, error)

func (*Minio) PutObject

func (m *Minio) PutObject(bucketName, objectName string, reader io.Reader, objectSize int64, mimeType string) (err error)

func (*Minio) Status

func (m *Minio) Status() error

type Storage

type Storage interface {
	Connect(cfg config.Provider) error
	Status() error

	BucketExists(name string) (bool, error)
	CreateBucket(name string, location ...string) error
	CreateBucketIfNotExists(name string, location ...string) error

	PutObject(bucketName, objectName string, reader io.Reader, objectSize int64, mimeType string) error
	GetObject(bucketName, objectName string) (io.ReadCloser, int64, error)
	DeleteObject(bucketName, objectName string) error
}

Storage interface provides functionalities to access an object storage driver.

Jump to

Keyboard shortcuts

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