fileserver

package
v0.0.52 Latest Latest
Warning

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

Go to latest
Published: Nov 18, 2026 License: Apache-2.0 Imports: 11 Imported by: 0 modules, 0 packages

The first number is the count of modules that contain a package that imports this one. The module count is a better indicator of popularity than the package count. A module with 100 importing packages is counted only once instead of 100 times, reflecting the fact that the choice to use the package was likely made only once, not 100 times.
A '?' means that the value hasn't been computed yet.

Documentation

Overview

Package fileserver serves the executor FileService over a Workspace.

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type Option

type Option func(*Server) error

Option configures a Server.

func WithMaxFileBytes

func WithMaxFileBytes(n int) Option

WithMaxFileBytes bounds the content of a file read or written.

func WithMaxPathBytes

func WithMaxPathBytes(n int) Option

WithMaxPathBytes bounds the length of a path or pattern.

func WithMaxResults

func WithMaxResults(n int) Option

WithMaxResults bounds the entries of a listing, glob, or grep.

func WithPathEscapeErrors

func WithPathEscapeErrors(errs ...error) Option

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 New

func New(ws Workspace, opts ...Option) (*Server, error)

New returns a server for ws.

func (*Server) CopyFile

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

Glob returns the paths matching a pattern.

func (*Server) Grep

Grep returns the lines matching a regular expression.

func (*Server) ReadDir

ReadDir lists the immediate children of a directory.

func (*Server) ReadFile

ReadFile streams a file and ends with the version of the bytes sent.

func (*Server) RemoveFile

RemoveFile removes a file or empty directory.

func (*Server) RenameFile

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

ResolveAuthorityPath returns the physical target of a workspace path.

func (*Server) StatFile

StatFile describes one path.

type Workspace

Workspace is the file system the service serves.

Jump to

Keyboard shortcuts

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