fsserver

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: 14 Imported by: 0

Documentation

Overview

Package fsserver implements a gRPC server to do local file IO.

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func RegisterService

func RegisterService(s grpc.ServiceRegistrar, callbacks Callbacks)

RegisterService creates the services and registers it with the given gRPC server.

Types

type Callbacks

type Callbacks interface {
	PeerFromContext(context.Context) (Peer, codes.Code, error)
	ResolvePath(peer Peer, path string) (string, codes.Code, error)
}

Callbacks are the callbacks this library needs from callers.

type Peer

type Peer interface{}

Peer is an opaque object representing a peer.

type Service

type Service struct {
	// "Unsafe" so it doesn't compile if we don't implement all the methods.
	pb.UnsafeRemoteFileSystemServiceServer
	// contains filtered or unexported fields
}

Service implements pb.RemoteFileSystemServiceServer and can be registered with a grpc.Server.

func NewService

func NewService(callbacks Callbacks) *Service

NewService instantiates a new Service.

func (*Service) Close

func (s *Service) Close(ctx context.Context, req *pb.CloseRequest) (*empty.Empty, error)

func (*Service) Fstat

func (s *Service) Fstat(ctx context.Context, req *pb.FstatRequest) (*pb.StatResponse, error)

func (*Service) Fsync

func (s *Service) Fsync(ctx context.Context, req *pb.FsyncRequest) (*empty.Empty, error)

func (*Service) Ftruncate

func (s *Service) Ftruncate(ctx context.Context, req *pb.FtruncateRequest) (*empty.Empty, error)

func (*Service) KeepAlive

func (s *Service) KeepAlive(ctx context.Context, req *pb.KeepAliveRequest) (*empty.Empty, error)

func (*Service) Mkdir

func (s *Service) Mkdir(ctx context.Context, req *pb.MkdirRequest) (*empty.Empty, error)

func (*Service) Open

func (s *Service) Open(ctx context.Context, req *pb.OpenRequest) (*pb.OpenResponse, error)

func (*Service) Read

func (s *Service) Read(ctx context.Context, req *pb.ReadRequest) (*pb.ReadResponse, error)

func (*Service) ReadAt

func (s *Service) ReadAt(ctx context.Context, req *pb.ReadAtRequest) (*pb.ReadResponse, error)

func (*Service) Readdir

func (s *Service) Readdir(ctx context.Context, req *pb.ReaddirRequest) (*pb.ReaddirResponse, error)

func (*Service) Rename

func (s *Service) Rename(ctx context.Context, req *pb.RenameRequest) (*empty.Empty, error)

func (*Service) Rmdir

func (s *Service) Rmdir(ctx context.Context, req *pb.RmdirRequest) (*empty.Empty, error)

func (*Service) Seek

func (s *Service) Seek(ctx context.Context, req *pb.SeekRequest) (*pb.SeekResponse, error)

func (*Service) Stat

func (s *Service) Stat(ctx context.Context, req *pb.StatRequest) (*pb.StatResponse, error)

func (*Service) Truncate

func (s *Service) Truncate(ctx context.Context, req *pb.TruncateRequest) (*empty.Empty, error)
func (s *Service) Unlink(ctx context.Context, req *pb.UnlinkRequest) (*empty.Empty, error)

func (*Service) Write

func (s *Service) Write(ctx context.Context, req *pb.WriteRequest) (*pb.WriteResponse, error)

func (*Service) WriteAt

func (s *Service) WriteAt(ctx context.Context, req *pb.WriteAtRequest) (*pb.WriteResponse, error)

Jump to

Keyboard shortcuts

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