Documentation
¶
Index ¶
- type GoFSOperations
- type PCloud
- func (fs *PCloud) MkDir(ctx context.Context, path string) error
- func (fs *PCloud) MkFile(ctx context.Context, path string, dataCh <-chan []byte) (err error)
- func (fs *PCloud) MvDir(ctx context.Context, fromPath string, toPath string) error
- func (fs *PCloud) MvFile(ctx context.Context, fromPath string, toPath string) error
- func (fs *PCloud) RmDir(ctx context.Context, path string) error
- func (fs *PCloud) RmFile(ctx context.Context, path string) error
- func (fs *PCloud) StreamFileData(ctx context.Context, fsEntry db.FSEntry) (<-chan []byte, <-chan error)
- type Unix
- func (fs *Unix) MkDir(ctx context.Context, path string) error
- func (fs *Unix) MkFile(ctx context.Context, path string, dataCh <-chan []byte) (err error)
- func (fs *Unix) MvDir(ctx context.Context, fromPath string, toPath string) error
- func (fs *Unix) MvFile(ctx context.Context, fromPath string, toPath string) error
- func (fs *Unix) RmDir(ctx context.Context, path string) error
- func (fs *Unix) RmFile(ctx context.Context, path string) error
- func (fs *Unix) StreamFileData(ctx context.Context, fsEntry db.FSEntry) (<-chan []byte, <-chan error)
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
This section is empty.
Types ¶
type GoFSOperations ¶
type GoFSOperations struct{}
GoFSOperations provides abstractions stubs for some of Go's OS operations.
func (*GoFSOperations) MkdirAll ¶
func (fso *GoFSOperations) MkdirAll(path string, perm os.FileMode) error
MkdirAll is glue code for os.MkdirAll.
type PCloud ¶
type PCloud struct {
// contains filtered or unexported fields
}
PCloud is a file system abstraction for the PCloud file system.
func NewPCloud ¶
func NewPCloud(sdk pCloudSDK) *PCloud
NewPCloud creates a new initialised PCloud structure.
func (*PCloud) MkFile ¶
MkFile creates a file with the contents streamed through dataCh. TODO: wrap the dataCh into a io.ReadWriter so to keep the code simple and offer a familiar Go feel.
func (*PCloud) StreamFileData ¶
func (fs *PCloud) StreamFileData(ctx context.Context, fsEntry db.FSEntry) (<-chan []byte, <-chan error)
StreamFileData reads the contents of the file pointed to by fsEntry and streams it to the channel the method returns. TODO: wrap the dataCh into a io.ReadWriter so to keep the code simple and offer a familiar Go feel.
type Unix ¶
type Unix struct {
// contains filtered or unexported fields
}
Unix is a file system abstraction for Unix-type file systems.
func NewUnix ¶
func NewUnix(fsOps fsOperations) *Unix
NewUnix creates a new initialised Unix structure.
func (*Unix) MkFile ¶
MkFile creates a file with the contents streamed through dataCh. TODO: wrap the dataCh into a io.ReadWriter so to keep the code simple and offer a familiar Go feel.
func (*Unix) StreamFileData ¶
func (fs *Unix) StreamFileData(ctx context.Context, fsEntry db.FSEntry) (<-chan []byte, <-chan error)
StreamFileData reads the contents of the file pointed to by fsEntry and streams it to the channel the method returns. TODO: wrap the dataCh into a io.ReadWriter so to keep the code simple and offer a familiar Go feel.