fsserver

package
v0.0.6 Latest Latest
Warning

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

Go to latest
Published: Mar 13, 2022 License: BSD-2-Clause Imports: 13 Imported by: 1

Documentation

Overview

Package fsserver implements a gRPC server which passes calls to Billy.

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 {
	// FilesystemForPeer is supposed to grab the peer from context.Context and return the filesystem you want to serve that peer; or an error code and an error.
	// codes.Code and error are separate to force you to think about the error code.
	FilesystemForPeer(context.Context) (billy.Filesystem, codes.Code, error)
}

Callbacks are the callbacks this library needs from callers.

type Service

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

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

func NewService

func NewService(callbacks Callbacks) *Service

NewService instantiates a new Service.

func (*Service) Chmod

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

func (*Service) Chown

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

func (*Service) Chtimes

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

func (*Service) FileDescriptor

func (s *Service) FileDescriptor(stream pb.BillyService_FileDescriptorServer) error

func (*Service) Lchown

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

func (*Service) Lstat

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

func (*Service) MkdirAll

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

func (*Service) ReadDir

func (s *Service) ReadDir(ctx context.Context, req *pb.ReadDirRequest) (*pb.ReadDirResponse, error)
func (s *Service) Readlink(ctx context.Context, req *pb.ReadlinkRequest) (*pb.ReadlinkResponse, error)

func (*Service) Remove

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

func (*Service) Rename

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

func (*Service) Stat

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

Jump to

Keyboard shortcuts

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