fileconformance

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: 14 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 fileconformance checks a FileService implementation through its gRPC client.

Index

Constants

View Source
const ChunkBytes = 3 << 20

ChunkBytes is the most content Workspace sends in one write message.

Variables

This section is empty.

Functions

func Dial

Dial serves srv on an in-memory listener and returns a client of it.

func Reason

func Reason(err error) executorv1.ErrorReason

Reason returns the ErrorReason a status error carries.

func Run

func Run(t *testing.T, newTarget func(t *testing.T) Target)

Run runs the Workspace conformance suites against the service through Workspace.

Types

type Target

type Target struct {
	Client   executorv1.FileServiceClient
	Root     string
	External fsconformance.ExternalAccess
}

Target is a fresh service and another actor on the files it serves.

type Workspace

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

Workspace is a minimal tool.Workspace over a FileService client.

func NewWorkspace

func NewWorkspace(client executorv1.FileServiceClient, root string) *Workspace

NewWorkspace returns a Workspace reporting root that calls client.

func (*Workspace) CopyFile

func (w *Workspace) CopyFile(
	ctx context.Context,
	source string,
	destination string,
) (tool.FileVersion, error)

CopyFile implements tool.WorkspaceNamespace.

func (*Workspace) CreateFile

func (w *Workspace) CreateFile(
	ctx context.Context,
	path string,
	data []byte,
) (tool.FileVersion, error)

CreateFile implements tool.Workspace.

func (*Workspace) Glob

func (w *Workspace) Glob(ctx context.Context, pattern string) ([]string, error)

Glob implements tool.Workspace.

func (*Workspace) Grep

func (w *Workspace) Grep(ctx context.Context, pattern, pathGlob string) ([]tool.GrepMatch, error)

Grep implements tool.Workspace.

func (*Workspace) Read

func (w *Workspace) Read(ctx context.Context, path string) ([]byte, error)

Read implements tool.Workspace.

func (*Workspace) ReadDir

func (w *Workspace) ReadDir(ctx context.Context, path string) ([]tool.FileInfo, error)

ReadDir implements tool.WorkspaceNamespace.

func (*Workspace) ReadVersion

func (w *Workspace) ReadVersion(
	ctx context.Context,
	path string,
) ([]byte, tool.FileVersion, error)

ReadVersion implements tool.Workspace.

func (*Workspace) Remove

func (w *Workspace) Remove(ctx context.Context, path string) error

Remove implements tool.WorkspaceNamespace.

func (*Workspace) Rename

func (w *Workspace) Rename(ctx context.Context, oldPath, newPath string) error

Rename implements tool.WorkspaceNamespace.

func (*Workspace) ReplaceFile

func (w *Workspace) ReplaceFile(
	ctx context.Context,
	path string,
	old tool.FileVersion,
	data []byte,
) (tool.FileVersion, error)

ReplaceFile implements tool.Workspace.

func (*Workspace) Root

func (w *Workspace) Root() string

Root implements tool.Workspace.

func (*Workspace) Stat

func (w *Workspace) Stat(ctx context.Context, path string) (tool.FileInfo, error)

Stat implements tool.Workspace.

Jump to

Keyboard shortcuts

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