storage

package
v0.0.0-...-f5f6e58 Latest Latest
Warning

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

Go to latest
Published: Apr 8, 2015 License: MIT Imports: 5 Imported by: 4

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func IsExistError

func IsExistError(err error) bool

func IsNotExistError

func IsNotExistError(err error) bool

Types

type ExistError

type ExistError struct {
	Op   string
	Path string
	Err  error
}

func (*ExistError) Error

func (e *ExistError) Error() string

type MetaData

type MetaData struct {
	Id           string      `json:"id"`
	Path         string      `json:"path"`
	Size         int64       `json:"size"`
	IsCol        bool        `json:"isCol"`
	MimeType     string      `json:"mimeType"`
	Checksum     string      `json:"checksum"`
	ChecksumType string      `json:"checksumType"`
	Modified     int64       `json:"modified"`
	ETag         string      `json:"etag"`
	Children     []*MetaData `json:"children"`
	Extra        interface{} `json:"extra"` // maybe to save xattrs or custom user data
}

type NotExistError

type NotExistError struct {
	Op   string
	Path string
	Err  error
}

func (*NotExistError) Error

func (e *NotExistError) Error() string

type StorageProvider

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

func NewStorageProvider

func NewStorageProvider(rootDataDir, rootTempDir string) (*StorageProvider, error)

func (*StorageProvider) Copy

func (sp *StorageProvider) Copy(from, to string) error

func (*StorageProvider) CreateCol

func (sp *StorageProvider) CreateCol(path string, recursive bool) error

func (*StorageProvider) GetFile

func (sp *StorageProvider) GetFile(path string) (io.Reader, error)

func (*StorageProvider) PutFile

func (sp *StorageProvider) PutFile(path string, r io.Reader, size int64) error

func (*StorageProvider) Remove

func (sp *StorageProvider) Remove(path string, recursive bool) error

Delete removed the resource identified by the id param or it returns error in case of failure.

func (*StorageProvider) Rename

func (sp *StorageProvider) Rename(from, to string) error

func (*StorageProvider) Stat

func (sp *StorageProvider) Stat(path string, children bool) (*MetaData, error)

Jump to

Keyboard shortcuts

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