storage

package
v0.0.0-...-1787dd6 Latest Latest
Warning

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

Go to latest
Published: Aug 12, 2024 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 DiskStorage

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

func NewDiskStorage

func NewDiskStorage(path string, log logger.Logger) *DiskStorage

func (*DiskStorage) GetFile

func (c *DiskStorage) GetFile(fileName string) (content []byte, err error)

func (*DiskStorage) GetStorageDirectory

func (c *DiskStorage) GetStorageDirectory() string

func (*DiskStorage) PutFile

func (c *DiskStorage) PutFile(fileName string, contents []byte) (err error)

type ObjectStorage

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

func NewObjectStorage

func NewObjectStorage(client *minio.Client, bucket string, cache *DiskStorage) *ObjectStorage

func (*ObjectStorage) GetFile

func (o *ObjectStorage) GetFile(objectName string) (contents []byte, err error)

func (*ObjectStorage) GetStorageDirectory

func (o *ObjectStorage) GetStorageDirectory() string

func (*ObjectStorage) PutFile

func (o *ObjectStorage) PutFile(objectName string, contents []byte) (err error)

type Storage

type Storage interface {
	GetStorageDirectory() string
	GetFile(fileName string) ([]byte, error)
	PutFile(fileName string, contents []byte) error
}

Jump to

Keyboard shortcuts

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