storage

package
v0.0.0-...-5fe3b72 Latest Latest
Warning

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

Go to latest
Published: Jan 9, 2020 License: Apache-2.0 Imports: 14 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func Lock

func Lock(url string) (io.Closer, error)

Lock acquires an advisory exclusive lock on the object specified, potentially creating it if it does not already exist.

func LockContext

func LockContext(ctx context.Context, url string) (io.Closer, error)

Lock acquires an advisory exclusive lock on the object specified, potentially creating it if it does not already exist.

func RLock

func RLock(url string) (io.Closer, error)

RLock acquires an advisory shared lock on the object specified, potentially creating it if it does not already exist.

func RLockContext

func RLockContext(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.

func Readdir

func Readdir(url string) ([]os.FileInfo, error)

Readdir reads the contents of the directory and returns a slice of FileInfo values, as would be returned by Stat, in directory order.

func ReaddirContext

func ReaddirContext(ctx context.Context, url string) ([]os.FileInfo, error)

Readdir reads the contents of the directory and returns a slice of FileInfo values, as would be returned by Stat, in directory order.

func Remove

func Remove(url string) error

Remove an object

func RemoveContext

func RemoveContext(ctx context.Context, url string) error

Remove an object

func Stat

func Stat(url string) (os.FileInfo, error)

Stat returns a FileInfo describing the Object

func StatContext

func StatContext(ctx context.Context, url string) (os.FileInfo, error)

Stat returns a FileInfo describing the Object

func Visit

func Visit(url string, visitor Visitor) error

Recursively visit a directory hierarchy

func VisitContext

func VisitContext(ctx context.Context, url string, visitor Visitor) error

Recursively visit a directory hierarchy

Types

type AnonymousObject

type AnonymousObject interface {
	driver.AnonymousObject
}

AnonymousObject represents a read-only, fixed size, random access object.

func Concat

func Concat(objects ...AnonymousObject) AnonymousObject

func ConcurrentConcat

func ConcurrentConcat(objects ...AnonymousObject) AnonymousObject

func Slice

func Slice(o AnonymousObject, off int64, n int64) AnonymousObject

Slice returns an AnonymousObject that reads from o starting at offset off and stops with EOF after n bytes.

type CommitInfo

type CommitInfo interface {
	driver.CommitInfo
}

type Object

type Object interface {
	driver.Object
}

Object represents a AnonymousObject with a URL

func Open

func Open(url string) (Object, error)

Open opens the Object for reading.

func OpenContextSize

func OpenContextSize(ctx context.Context, url string, size int64) (Object, error)

Open opens the Object with the context and declared size.

func OpenSize

func OpenSize(url string, size int64) (Object, error)

Open opens the Object for reading.

func WithURL

func WithURL(o AnonymousObject, url string) Object

WithURL gives a URL to an AnonymousObject

type ObjectWriter

type ObjectWriter interface {
	driver.ObjectWriter
}

ObjectWriter is a handle for creating an Object

func Create

func Create(url string) (ObjectWriter, error)

Create an ObjectWriter handle

func CreateContext

func CreateContext(ctx context.Context, url string) (ObjectWriter, error)

Create an ObjectWriter handle

type Visitor

type Visitor interface {
	driver.Visitor
}

Visitor is used with Visit to recursively traverse a directory hierarchy

type VisitorConcurrency

type VisitorConcurrency interface {
	driver.Visitor
	driver.VisitorConcurrency
}

VisitorConcurrency is used to extend Visitor to control the concurrency of recursive descent.

type VisitorPredicate

type VisitorPredicate interface {
	driver.Visitor
	driver.VisitorPredicate
}

VisitorPredicate is used to extend Visitor to control which directories are visited

type VisitorTraversal

type VisitorTraversal interface {
	driver.Visitor
	driver.VisitorTraversal
}

VisitorTraversal is used to extend Visitor to control depth-first vs breadth-first traversal. The default for visitors that do not implement VisitorTraversal is breadth-first.

Directories

Path Synopsis

Jump to

Keyboard shortcuts

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