Documentation ¶
Index ¶
- type Filesystem
- type ListOptions
- type Local
- func (l *Local) Create(ctx context.Context, path string) (WriteHandle, error)
- func (l *Local) IsLocalDir(ctx context.Context, path string) bool
- func (l *Local) List(ctx context.Context, path string, opts *ListOptions) (ObjectIterator, error)
- func (l *Local) Move(ctx context.Context, oldpath, newpath string) error
- func (l *Local) Open(ctx context.Context, path string, opts *OpenOptions) (ReadHandle, error)
- func (l *Local) Remove(ctx context.Context, path string, opts *RemoveOptions) error
- func (l *Local) Stat(ctx context.Context, path string) (*ObjectInfo, error)
- type Mixed
- func (m *Mixed) Close() error
- func (m *Mixed) Create(ctx clingy.Context, loc ulloc.Location) (WriteHandle, error)
- func (m *Mixed) IsLocalDir(ctx context.Context, loc ulloc.Location) bool
- func (m *Mixed) List(ctx context.Context, prefix ulloc.Location, opts *ListOptions) (ObjectIterator, error)
- func (m *Mixed) Move(ctx clingy.Context, source, dest ulloc.Location) error
- func (m *Mixed) Open(ctx clingy.Context, loc ulloc.Location, opts *OpenOptions) (ReadHandle, error)
- func (m *Mixed) Remove(ctx context.Context, loc ulloc.Location, opts *RemoveOptions) error
- func (m *Mixed) Stat(ctx context.Context, loc ulloc.Location) (*ObjectInfo, error)
- type ObjectInfo
- type ObjectIterator
- type OpenOptions
- type ReadHandle
- type Remote
- func (r *Remote) Close() error
- func (r *Remote) Create(ctx context.Context, bucket, key string) (WriteHandle, error)
- func (r *Remote) List(ctx context.Context, bucket, prefix string, opts *ListOptions) ObjectIterator
- func (r *Remote) Move(ctx context.Context, oldbucket, oldkey, newbucket, newkey string) error
- func (r *Remote) Open(ctx context.Context, bucket, key string, opts *OpenOptions) (ReadHandle, error)
- func (r *Remote) Remove(ctx context.Context, bucket, key string, opts *RemoveOptions) error
- func (r *Remote) Stat(ctx context.Context, bucket, key string) (*ObjectInfo, error)
- type RemoveOptions
- type WriteHandle
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
This section is empty.
Types ¶
type Filesystem ¶
type Filesystem interface { Close() error Open(ctx clingy.Context, loc ulloc.Location, opts *OpenOptions) (ReadHandle, error) Create(ctx clingy.Context, loc ulloc.Location) (WriteHandle, error) Move(ctx clingy.Context, source, dest ulloc.Location) error Remove(ctx context.Context, loc ulloc.Location, opts *RemoveOptions) error List(ctx context.Context, prefix ulloc.Location, opts *ListOptions) (ObjectIterator, error) IsLocalDir(ctx context.Context, loc ulloc.Location) bool Stat(ctx context.Context, loc ulloc.Location) (*ObjectInfo, error) }
Filesystem represents either the local Filesystem or the data backed by a project.
type ListOptions ¶ added in v1.42.2
ListOptions describes options to the List command.
type Local ¶
type Local struct{}
Local implements something close to a filesystem but backed by the local disk.
func (*Local) Create ¶
Create makes any directories necessary to create a file at path and returns a WriteHandle.
func (*Local) IsLocalDir ¶
IsLocalDir returns true if the path is a directory.
func (*Local) List ¶ added in v1.42.2
func (l *Local) List(ctx context.Context, path string, opts *ListOptions) (ObjectIterator, error)
List returns an ObjectIterator listing files and directories that have string prefix with the provided path.
func (*Local) Open ¶
func (l *Local) Open(ctx context.Context, path string, opts *OpenOptions) (ReadHandle, error)
Open returns a read ReadHandle for the given local path.
type Mixed ¶
type Mixed struct {
// contains filtered or unexported fields
}
Mixed dispatches to either the local or remote filesystem depending on the location.
func (*Mixed) Create ¶
Create returns a WriteHandle to either a local file, remote object, or stdout.
func (*Mixed) IsLocalDir ¶
IsLocalDir returns true if the location is a directory that is local.
func (*Mixed) List ¶ added in v1.42.2
func (m *Mixed) List(ctx context.Context, prefix ulloc.Location, opts *ListOptions) (ObjectIterator, error)
List lists either files and directories with some local path prefix or remote objects with a given bucket and key.
func (*Mixed) Open ¶
func (m *Mixed) Open(ctx clingy.Context, loc ulloc.Location, opts *OpenOptions) (ReadHandle, error)
Open returns a ReadHandle to either a local file, remote object, or stdin.
type ObjectInfo ¶
type ObjectInfo struct { Loc ulloc.Location IsPrefix bool Created time.Time ContentLength int64 Expires time.Time Metadata uplink.CustomMetadata }
ObjectInfo is a simpler *uplink.Object that contains the minimal information the uplink command needs that multiple types can be converted to.
type ObjectIterator ¶
type ObjectIterator interface { Next() bool Err() error Item() ObjectInfo }
ObjectIterator is an interface type for iterating over objectInfo values.
type OpenOptions ¶ added in v1.43.1
OpenOptions describes options for Filesystem.Open.
type ReadHandle ¶
type ReadHandle interface { io.Reader io.Closer Info() ObjectInfo }
ReadHandle is something that can be read from.
type Remote ¶
type Remote struct {
// contains filtered or unexported fields
}
Remote implements something close to a filesystem but backed by an uplink project.
func NewRemote ¶
NewRemote returns something close to a filesystem and returns objects using the project.
func (*Remote) Create ¶
Create returns a WriteHandle for the object identified by a given bucket and key.
func (*Remote) List ¶ added in v1.42.2
func (r *Remote) List(ctx context.Context, bucket, prefix string, opts *ListOptions) ObjectIterator
List lists all of the objects in some bucket that begin with the given prefix.
func (*Remote) Open ¶
func (r *Remote) Open(ctx context.Context, bucket, key string, opts *OpenOptions) (ReadHandle, error)
Open returns a ReadHandle for the object identified by a given bucket and key.
type RemoveOptions ¶ added in v1.42.2
type RemoveOptions struct {
Pending bool
}
RemoveOptions describes options to the Remove command.