rpcfs

package
v0.0.0-...-ee9d8c9 Latest Latest
Warning

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

Go to latest
Published: Jun 28, 2023 License: MIT Imports: 4 Imported by: 0

Documentation

Overview

rpcfs implements the fs.FS interface using the 'net/rpc' package.

Index

Constants

View Source
const RPC_FILE_CLASS = "RpcFsServer"

rpc class name for requests

Variables

This section is empty.

Functions

This section is empty.

Types

type FopenReq

type FopenReq struct {
	Path string
	Flag int
	Perm os.FileMode
}

type FreadReq

type FreadReq struct {
	Fd uint
	N  int
}

type FreadRes

type FreadRes struct {
	B []byte
}

type FseekReq

type FseekReq struct {
	Fd     uint
	Offset int64
	Whence int
}

type FseekRes

type FseekRes struct {
	Pos int64
}

type FwriteReq

type FwriteReq struct {
	Fd uint
	B  []byte
}

type FwriteRes

type FwriteRes struct {
	N int
}

type ReaddirReq

type ReaddirReq struct {
	Path string
}

type ReaddirRes

type ReaddirRes struct {
	Entries []fs.DirEntry
}

type RemoteFile

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

func (*RemoteFile) Close

func (rf *RemoteFile) Close() error

func (*RemoteFile) Read

func (rf *RemoteFile) Read(b []byte) (n int, err error)

func (*RemoteFile) Seek

func (rf *RemoteFile) Seek(offset int64, whence int) (pos int64, err error)

func (*RemoteFile) Stat

func (rf *RemoteFile) Stat() (fs.FileInfo, error)

func (*RemoteFile) Write

func (rf *RemoteFile) Write(b []byte) (n int, err error)

type RpcFs

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

Client side of RpcFs.

func NewRpcFs

func NewRpcFs(parent context.Context, client *rpc.Client) *RpcFs

func (*RpcFs) Create

func (f *RpcFs) Create(path string) (*RemoteFile, error)

func (*RpcFs) Glob

func (f *RpcFs) Glob(pattern string) ([]string, error)

Implement GlobFS.Glob

func (*RpcFs) Open

func (f *RpcFs) Open(path string) (fs.File, error)

Implement FS.Open

func (*RpcFs) OpenFile

func (f *RpcFs) OpenFile(path string, flag int, perm fs.FileMode) (*RemoteFile, error)

func (*RpcFs) OpenRead

func (f *RpcFs) OpenRead(path string) (*RemoteFile, error)

func (*RpcFs) ReadDir

func (f *RpcFs) ReadDir(path string) ([]fs.DirEntry, error)

Implement ReadDirFS.ReadDir

type RpcFsServer

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

func NewRpcFsServer

func NewRpcFsServer(root string) *RpcFsServer

func (*RpcFsServer) Fclose

func (s *RpcFsServer) Fclose(fdint uint, res *bool) error

func (*RpcFsServer) Fopen

func (s *RpcFsServer) Fopen(req *FopenReq, res *uint) error

func (*RpcFsServer) Fread

func (s *RpcFsServer) Fread(req *FreadReq, res *FreadRes) (err error)

func (*RpcFsServer) Fseek

func (s *RpcFsServer) Fseek(req *FseekReq, res *FseekRes) (err error)

func (*RpcFsServer) Fstat

func (s *RpcFsServer) Fstat(fdint uint, info *fs.FileInfo) error

func (*RpcFsServer) Fwrite

func (s *RpcFsServer) Fwrite(req *FwriteReq, res *FwriteRes) (err error)

func (*RpcFsServer) Glob

func (s *RpcFsServer) Glob(pattern string, items *[]string) error

func (*RpcFsServer) ReadDir

func (s *RpcFsServer) ReadDir(req *ReaddirReq, res *ReaddirRes) error

Jump to

Keyboard shortcuts

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