fsclient

package
v1.0.0 Latest Latest
Warning

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

Go to latest
Published: Jul 21, 2021 License: BSD-2-Clause Imports: 13 Imported by: 0

Documentation

Overview

Package fsclient provides a fs.FS compatible client for talking to a gRPC RemoteFileSystemService server.

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type File

type File struct {
	// contains filtered or unexported fields
}

func (*File) Close

func (h *File) Close() error

func (*File) Read

func (h *File) Read(p []byte) (int, error)

func (*File) ReadAt

func (h *File) ReadAt(p []byte, offset int64) (int, error)

func (*File) Seek

func (h *File) Seek(offset int64, whence int) (int64, error)

func (*File) Stat

func (h *File) Stat() (fs.FileInfo, error)

func (*File) Sync

func (h *File) Sync() error

func (*File) Truncate

func (h *File) Truncate(size int64) error

func (*File) Write

func (h *File) Write(p []byte) (int, error)

func (*File) WriteAt

func (h *File) WriteAt(p []byte, offset int64) (int, error)

type FileSystem

type FileSystem struct {
	Files map[int64]*File
	// contains filtered or unexported fields
}

FileSystem provides an API to the remote filesystem.

func New

New creates a FileSystem object.

func (*FileSystem) Create

func (f *FileSystem) Create(name string) (*File, error)

func (*FileSystem) Open

func (f *FileSystem) Open(name string) (fs.File, error)

func (*FileSystem) OpenFile

func (f *FileSystem) OpenFile(name string, flags int, perm fs.FileMode) (*File, error)

func (*FileSystem) ReadDir

func (f *FileSystem) ReadDir(name string) ([]fs.DirEntry, error)

func (*FileSystem) Rename

func (f *FileSystem) Rename(oldName, newName string) error

TODO: Return *os.LinkError, not *os.PathError

func (*FileSystem) Stat

func (f *FileSystem) Stat(name string) (fs.FileInfo, error)

func (*FileSystem) Truncate

func (f *FileSystem) Truncate(name string, size int64) error

Jump to

Keyboard shortcuts

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