Documentation
¶
Overview ¶
Package fileserver serves the executor FileService over a Workspace.
Index ¶
- type Option
- type Server
- func (s *Server) CopyFile(ctx context.Context, req *executorv1.CopyFileRequest) (*executorv1.CopyFileResponse, error)
- func (s *Server) CreateFile(stream executorv1.FileService_CreateFileServer) error
- func (s *Server) Glob(ctx context.Context, req *executorv1.GlobRequest) (*executorv1.GlobResponse, error)
- func (s *Server) Grep(ctx context.Context, req *executorv1.GrepRequest) (*executorv1.GrepResponse, error)
- func (s *Server) ReadDir(ctx context.Context, req *executorv1.ReadDirRequest) (*executorv1.ReadDirResponse, error)
- func (s *Server) ReadFile(req *executorv1.ReadFileRequest, stream executorv1.FileService_ReadFileServer) error
- func (s *Server) RemoveFile(ctx context.Context, req *executorv1.RemoveFileRequest) (*executorv1.RemoveFileResponse, error)
- func (s *Server) RenameFile(ctx context.Context, req *executorv1.RenameFileRequest) (*executorv1.RenameFileResponse, error)
- func (s *Server) ReplaceFile(stream executorv1.FileService_ReplaceFileServer) error
- func (s *Server) ResolveAuthorityPath(_ context.Context, req *executorv1.ResolveAuthorityPathRequest) (*executorv1.ResolveAuthorityPathResponse, error)
- func (s *Server) StatFile(ctx context.Context, req *executorv1.StatFileRequest) (*executorv1.StatFileResponse, error)
- type Workspace
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
This section is empty.
Types ¶
type Option ¶
Option configures a Server.
func WithMaxFileBytes ¶
WithMaxFileBytes bounds the content of a file read or written.
func WithMaxPathBytes ¶
WithMaxPathBytes bounds the length of a path or pattern.
func WithMaxResults ¶
WithMaxResults bounds the entries of a listing, glob, or grep.
func WithPathEscapeErrors ¶
WithPathEscapeErrors names the workspace errors that report a path outside it.
type Server ¶
type Server struct {
executorv1.UnimplementedFileServiceServer
// contains filtered or unexported fields
}
Server implements executorv1.FileServiceServer.
func (*Server) CopyFile ¶
func (s *Server) CopyFile( ctx context.Context, req *executorv1.CopyFileRequest, ) (*executorv1.CopyFileResponse, error)
CopyFile copies a file to an absent destination.
func (*Server) CreateFile ¶
func (s *Server) CreateFile(stream executorv1.FileService_CreateFileServer) error
CreateFile writes a new file once the caller closes its stream.
func (*Server) Glob ¶
func (s *Server) Glob( ctx context.Context, req *executorv1.GlobRequest, ) (*executorv1.GlobResponse, error)
Glob returns the paths matching a pattern.
func (*Server) Grep ¶
func (s *Server) Grep( ctx context.Context, req *executorv1.GrepRequest, ) (*executorv1.GrepResponse, error)
Grep returns the lines matching a regular expression.
func (*Server) ReadDir ¶
func (s *Server) ReadDir( ctx context.Context, req *executorv1.ReadDirRequest, ) (*executorv1.ReadDirResponse, error)
ReadDir lists the immediate children of a directory.
func (*Server) ReadFile ¶
func (s *Server) ReadFile( req *executorv1.ReadFileRequest, stream executorv1.FileService_ReadFileServer, ) error
ReadFile streams a file and ends with the version of the bytes sent.
func (*Server) RemoveFile ¶
func (s *Server) RemoveFile( ctx context.Context, req *executorv1.RemoveFileRequest, ) (*executorv1.RemoveFileResponse, error)
RemoveFile removes a file or empty directory.
func (*Server) RenameFile ¶
func (s *Server) RenameFile( ctx context.Context, req *executorv1.RenameFileRequest, ) (*executorv1.RenameFileResponse, error)
RenameFile moves a path to an absent destination.
func (*Server) ReplaceFile ¶
func (s *Server) ReplaceFile(stream executorv1.FileService_ReplaceFileServer) error
ReplaceFile replaces a file at its expected version once the caller closes its stream.
func (*Server) ResolveAuthorityPath ¶
func (s *Server) ResolveAuthorityPath( _ context.Context, req *executorv1.ResolveAuthorityPathRequest, ) (*executorv1.ResolveAuthorityPathResponse, error)
ResolveAuthorityPath returns the physical target of a workspace path.
func (*Server) StatFile ¶
func (s *Server) StatFile( ctx context.Context, req *executorv1.StatFileRequest, ) (*executorv1.StatFileResponse, error)
StatFile describes one path.
type Workspace ¶
type Workspace interface {
tool.Workspace
tool.WorkspaceNamespace
tool.BoundedWorkspaceReader
tool.AuthorityResourceResolver
}
Workspace is the file system the service serves.