Documentation ¶
Index ¶
- Variables
- func AddDelimiterToPath(path string) string
- func DeleteObjectsWhere(folder Folder, confirm bool, objFilter func(object1 Object) bool, ...) error
- func GetPathFromPrefix(prefix string) (bucket, server string, err error)
- func JoinPath(elem ...string) string
- func ParsePrefixAsURL(prefix string) (bucket, server string, err error)
- func RunFolderTest(storageFolder Folder, t *testing.T)
- type Error
- type Folder
- type LocalObject
- type Object
- func ListFolderRecursively(folder Folder) (relativePathObjects []Object, err error)
- func ListFolderRecursivelyWithFilter(folder Folder, folderSelector func(path string) bool) (relativePathObjects []Object, err error)
- func ListFolderRecursivelyWithPrefix(folder Folder, prefix string) (relativePathObjects []Object, err error)
- type ObjectNotFoundError
- type ObjectProvider
Constants ¶
This section is empty.
Variables ¶
View Source
var ( ErrNoMoreObjects = errors.New("no more objects") ErrProviderClosed = errors.New("provider closed") )
Functions ¶
func AddDelimiterToPath ¶
func DeleteObjectsWhere ¶
func GetPathFromPrefix ¶
func ParsePrefixAsURL ¶
Types ¶
type Folder ¶
type Folder interface { // Path should always ends with '/' GetPath() string // Should return objects with relative paths ListFolder() (objects []Object, subFolders []Folder, err error) // Delete object, if exists DeleteObjects(objectRelativePaths []string) error Exists(objectRelativePath string) (bool, error) // Returns handle to subfolder. Does not have to instantiate subfolder in any material form GetSubFolder(subFolderRelativePath string) Folder // Should return ObjectNotFoundError in case, there is no such object ReadObject(objectRelativePath string) (io.ReadCloser, error) PutObject(name string, content io.Reader) error CopyObject(srcPath string, dstPath string) error }
type LocalObject ¶
type LocalObject struct {
// contains filtered or unexported fields
}
func NewLocalObject ¶
func NewLocalObject(name string, lastModified time.Time, size int64) *LocalObject
func (LocalObject) GetLastModified ¶
func (object LocalObject) GetLastModified() time.Time
func (LocalObject) GetName ¶
func (object LocalObject) GetName() string
func (LocalObject) GetSize ¶
func (object LocalObject) GetSize() int64
type ObjectNotFoundError ¶
type ObjectNotFoundError struct {
// contains filtered or unexported fields
}
func NewObjectNotFoundError ¶
func NewObjectNotFoundError(path string) ObjectNotFoundError
func (ObjectNotFoundError) Error ¶
func (err ObjectNotFoundError) Error() string
type ObjectProvider ¶
type ObjectProvider struct {
// contains filtered or unexported fields
}
func NewLowMemoryObjectProvider ¶
func NewLowMemoryObjectProvider() *ObjectProvider
func (*ObjectProvider) AddError ¶
func (p *ObjectProvider) AddError(err error) bool
func (*ObjectProvider) AddObject ¶
func (p *ObjectProvider) AddObject(o Object) error
func (*ObjectProvider) Close ¶
func (p *ObjectProvider) Close()
func (*ObjectProvider) GetObject ¶
func (p *ObjectProvider) GetObject() (Object, error)
func (*ObjectProvider) HandleError ¶
func (p *ObjectProvider) HandleError(err error)
func (*ObjectProvider) ObjectsCount ¶
func (p *ObjectProvider) ObjectsCount() int
Source Files ¶
Click to show internal directories.
Click to hide internal directories.