storage

package
v1.5.0 Latest Latest
Warning

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

Go to latest
Published: Nov 11, 2023 License: MIT Imports: 16 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type Bucket

type Bucket struct {
	Name string
	Path string
}

type ObjectStorage

type ObjectStorage interface {
	GetBucket(name string) (Bucket, error)
	UpsertBucket(name string) (Bucket, error)

	DeleteBucket(bucket Bucket) error
	GetBucketQuota(bucket Bucket) (uint64, error)
	GetFile(bucket Bucket, fpath string) (utils.ReaderAtCloser, int64, time.Time, error)
	PutFile(bucket Bucket, fpath string, contents utils.ReaderAtCloser, entry *utils.FileEntry) (string, error)
	DeleteFile(bucket Bucket, fpath string) error
	ListFiles(bucket Bucket, dir string, recursive bool) ([]os.FileInfo, error)
}

type StorageFS

type StorageFS struct {
	Dir string
}

func NewStorageFS

func NewStorageFS(dir string) (*StorageFS, error)

func (*StorageFS) DeleteBucket

func (s *StorageFS) DeleteBucket(bucket Bucket) error

func (*StorageFS) DeleteFile

func (s *StorageFS) DeleteFile(bucket Bucket, fpath string) error

func (*StorageFS) GetBucket

func (s *StorageFS) GetBucket(name string) (Bucket, error)

func (*StorageFS) GetBucketQuota

func (s *StorageFS) GetBucketQuota(bucket Bucket) (uint64, error)

func (*StorageFS) GetFile

func (s *StorageFS) GetFile(bucket Bucket, fpath string) (utils.ReaderAtCloser, int64, time.Time, error)

func (*StorageFS) ListFiles

func (s *StorageFS) ListFiles(bucket Bucket, dir string, recursive bool) ([]os.FileInfo, error)

func (*StorageFS) PutFile

func (s *StorageFS) PutFile(bucket Bucket, fpath string, contents utils.ReaderAtCloser, entry *utils.FileEntry) (string, error)

func (*StorageFS) UpsertBucket

func (s *StorageFS) UpsertBucket(name string) (Bucket, error)

type StorageMinio

type StorageMinio struct {
	Client *minio.Client
	Admin  *madmin.AdminClient
}

func NewStorageMinio

func NewStorageMinio(address, user, pass string) (*StorageMinio, error)

func (*StorageMinio) DeleteBucket

func (s *StorageMinio) DeleteBucket(bucket Bucket) error

func (*StorageMinio) DeleteFile

func (s *StorageMinio) DeleteFile(bucket Bucket, fpath string) error

func (*StorageMinio) GetBucket

func (s *StorageMinio) GetBucket(name string) (Bucket, error)

func (*StorageMinio) GetBucketQuota

func (s *StorageMinio) GetBucketQuota(bucket Bucket) (uint64, error)

func (*StorageMinio) GetFile

func (s *StorageMinio) GetFile(bucket Bucket, fpath string) (utils.ReaderAtCloser, int64, time.Time, error)

func (*StorageMinio) ListFiles

func (s *StorageMinio) ListFiles(bucket Bucket, dir string, recursive bool) ([]os.FileInfo, error)

func (*StorageMinio) PutFile

func (s *StorageMinio) PutFile(bucket Bucket, fpath string, contents utils.ReaderAtCloser, entry *utils.FileEntry) (string, error)

func (*StorageMinio) UpsertBucket

func (s *StorageMinio) UpsertBucket(name string) (Bucket, error)

Jump to

Keyboard shortcuts

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