filesystem

package
v0.11.0 Latest Latest
Warning

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

Go to latest
Published: Apr 24, 2024 License: Apache-2.0 Imports: 8 Imported by: 0

Documentation

Index

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.

func (*GoFSOperations) Open

func (fso *GoFSOperations) Open(name string) (*os.File, error)

Open is glue code for os.Open.

func (*GoFSOperations) OpenFile

func (fso *GoFSOperations) OpenFile(name string, flag int, perm os.FileMode) (*os.File, error)

OpenFile is glue code for os.OpenFile.

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) MkDir

func (fs *PCloud) MkDir(ctx context.Context, path string) error

MkDir creates a directory.

func (*PCloud) MkFile

func (fs *PCloud) MkFile(ctx context.Context, path string, dataCh <-chan []byte) (err error)

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) MvDir

func (fs *PCloud) MvDir(ctx context.Context, fromPath string, toPath string) error

MvDir moves a directory.

func (*PCloud) MvFile

func (fs *PCloud) MvFile(ctx context.Context, fromPath string, toPath string) error

MvFile moves a file.

func (*PCloud) RmDir

func (fs *PCloud) RmDir(ctx context.Context, path string) error

RmDir removes a directory.

func (*PCloud) RmFile

func (fs *PCloud) RmFile(ctx context.Context, path string) error

RmFile removes a file.

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) MkDir

func (fs *Unix) MkDir(ctx context.Context, path string) error

MkDir creates a directory.

func (*Unix) MkFile

func (fs *Unix) MkFile(ctx context.Context, path string, dataCh <-chan []byte) (err error)

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) MvDir

func (fs *Unix) MvDir(ctx context.Context, fromPath string, toPath string) error

MvDir moves a directory.

func (*Unix) MvFile

func (fs *Unix) MvFile(ctx context.Context, fromPath string, toPath string) error

MvFile moves a file.

func (*Unix) RmDir

func (fs *Unix) RmDir(ctx context.Context, path string) error

RmDir removes a directory.

func (*Unix) RmFile

func (fs *Unix) RmFile(ctx context.Context, path string) error

RmFile removes a file.

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.

Jump to

Keyboard shortcuts

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