Documentation ¶
Index ¶
- Variables
- func Drivers() []string
- func Register(scheme string, driver Driver)
- func Visit(ctx context.Context, drvr Readdirer, root string, visitor Visitor) error
- type AnonymousObject
- type CommitInfo
- type ComprehensiveDriver
- type Creator
- type Driver
- type Locker
- type Object
- type ObjectWriter
- type Readdirer
- type Remover
- type Undo
- type Visitor
- type VisitorConcurrency
- type VisitorPredicate
- type VisitorTraversal
- type XattrObject
- type XattrObjectWriter
Constants ¶
This section is empty.
Variables ¶
View Source
var CommitOnAbortedObjectWriter = errors.New("commit on aborted ObjectWriter")
Functions ¶
func Drivers ¶
func Drivers() []string
Drivers returns a sorted list of the URL schemes of the registered drivers.
Types ¶
type AnonymousObject ¶
AnonymousObject represents a read-only, fixed size, random access object.
type CommitInfo ¶
type CommitInfo interface { // ObjectURL returns the final URL of the committed object ObjectURL() string }
func NewCommitInfo ¶
func NewCommitInfo(url string) CommitInfo
NewCommitInfo is a helper function for storage drivers
type ComprehensiveDriver ¶
Useful for mocking
type Creator ¶
type Creator interface { // Create an ObjectWriter handle Create(ctx context.Context, url string) (ObjectWriter, error) }
type Driver ¶
type Driver interface { // Name returns the display name of this driver Name() string // Open opens the Object for reading. Open(ctx context.Context, url string, size int64) (Object, error) // Stat returns a FileInfo describing the Object. Stat(ctx context.Context, url string) (os.FileInfo, error) }
Driver is the interface that must be implemented by a storage driver.
type Locker ¶
type Locker interface { // Lock acquires an advisory exclusive lock on the object // specified, potentially creating it if it does not already // exist. Lock(ctx context.Context, url string) (io.Closer, error) // RLock acquires an advisory shared lock on the object specified, // potentially creating it if it does not already exist. RLock(ctx context.Context, url string) (io.Closer, error) }
type Object ¶
type Object interface { AnonymousObject URL() string }
Object represents a AnonymousObject with a URL
type ObjectWriter ¶
type ObjectWriter interface { io.Writer Abort() Commit() (CommitInfo, error) }
ObjectWriter is a handle for creating an Object
type Undo ¶
type Undo func()
func ClearRegistry ¶
func ClearRegistry() Undo
Temporarily unregister all the default drivers until Undo is called.
type VisitorConcurrency ¶
type VisitorConcurrency interface {
Concurrency() int
}
type VisitorPredicate ¶
type VisitorTraversal ¶
type VisitorTraversal interface {
DepthFirst() bool
}
type XattrObjectWriter ¶
type XattrObjectWriter interface { ObjectWriter SetXattr(name string, value []byte) error }
Click to show internal directories.
Click to hide internal directories.