metathings_deviced_simple_storage

package
v1.2.0 Latest Latest
Warning

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

Go to latest
Published: Jul 24, 2020 License: MIT Imports: 16 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

View Source
var (
	ErrInvalidSimpleStorageDriver = errors.New("invalid simple storage driver")
)

Functions

This section is empty.

Types

type FileSimpleStorage

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

func (*FileSimpleStorage) GetObject

func (fss *FileSimpleStorage) GetObject(x *Object) (y *Object, err error)

func (*FileSimpleStorage) GetObjectContent

func (fss *FileSimpleStorage) GetObjectContent(obj *Object) (chan []byte, error)

func (*FileSimpleStorage) GetObjectContentSync added in v1.2.0

func (fss *FileSimpleStorage) GetObjectContentSync(obj *Object) ([]byte, error)

func (*FileSimpleStorage) ListObjects

func (fss *FileSimpleStorage) ListObjects(obj *Object, opt *ListObjectsOption) ([]*Object, error)

func (*FileSimpleStorage) PutObject

func (fss *FileSimpleStorage) PutObject(obj *Object, reader io.Reader) error

func (*FileSimpleStorage) PutObjectAsync added in v1.1.16

func (fss *FileSimpleStorage) PutObjectAsync(obj *Object, opt *PutObjectAsyncOption) (*file_helper.FileSyncer, error)

func (*FileSimpleStorage) RemoveObject

func (fss *FileSimpleStorage) RemoveObject(obj *Object) error

func (*FileSimpleStorage) RenameObject

func (fss *FileSimpleStorage) RenameObject(src, dst *Object) error

type FileSimpleStorageOption

type FileSimpleStorageOption struct {
	Home            string
	ReadBufferSize  int
	WriteBufferSize int
}

func NewFileSimpleStorageOption

func NewFileSimpleStorageOption() *FileSimpleStorageOption

type ListObjectsOption added in v1.1.16

type ListObjectsOption struct {
	Recursive bool
	Depth     int
}

type Object

type Object struct {
	Device       string
	Prefix       string
	Name         string
	Length       int64
	Etag         string
	LastModified time.Time
}

func NewObject

func NewObject(device, prefix, name string) *Object

func (*Object) FullName

func (o *Object) FullName() string

type PutObjectAsyncOption added in v1.1.16

type PutObjectAsyncOption struct {
	SHA1      string
	ChunkSize int64
}

type SimpleStorage

type SimpleStorage interface {
	PutObject(obj *Object, reader io.Reader) error
	PutObjectAsync(obj *Object, opt *PutObjectAsyncOption) (*file_helper.FileSyncer, error)
	RemoveObject(obj *Object) error
	RenameObject(src, dst *Object) error
	GetObject(obj *Object) (*Object, error)
	GetObjectContent(obj *Object) (chan []byte, error)
	GetObjectContentSync(obj *Object) ([]byte, error)
	ListObjects(obj *Object, opt *ListObjectsOption) ([]*Object, error)
}

func NewSimpleStorage

func NewSimpleStorage(name string, args ...interface{}) (SimpleStorage, error)

type SimpleStorageFactory

type SimpleStorageFactory func(...interface{}) (SimpleStorage, error)

Jump to

Keyboard shortcuts

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