Documentation
¶
Overview ¶
Package fileconformance checks a FileService implementation through its gRPC client.
Index ¶
- Constants
- func Dial(t *testing.T, srv executorv1.FileServiceServer) executorv1.FileServiceClient
- func Reason(err error) executorv1.ErrorReason
- func Run(t *testing.T, newTarget func(t *testing.T) Target)
- type Target
- type Workspace
- func (w *Workspace) CopyFile(ctx context.Context, source string, destination string) (tool.FileVersion, error)
- func (w *Workspace) CreateFile(ctx context.Context, path string, data []byte) (tool.FileVersion, error)
- func (w *Workspace) Glob(ctx context.Context, pattern string) ([]string, error)
- func (w *Workspace) Grep(ctx context.Context, pattern, pathGlob string) ([]tool.GrepMatch, error)
- func (w *Workspace) Read(ctx context.Context, path string) ([]byte, error)
- func (w *Workspace) ReadDir(ctx context.Context, path string) ([]tool.FileInfo, error)
- func (w *Workspace) ReadVersion(ctx context.Context, path string) ([]byte, tool.FileVersion, error)
- func (w *Workspace) Remove(ctx context.Context, path string) error
- func (w *Workspace) Rename(ctx context.Context, oldPath, newPath string) error
- func (w *Workspace) ReplaceFile(ctx context.Context, path string, old tool.FileVersion, data []byte) (tool.FileVersion, error)
- func (w *Workspace) Root() string
- func (w *Workspace) Stat(ctx context.Context, path string) (tool.FileInfo, error)
Constants ¶
const ChunkBytes = 3 << 20
ChunkBytes is the most content Workspace sends in one write message.
Variables ¶
This section is empty.
Functions ¶
func Dial ¶
func Dial(t *testing.T, srv executorv1.FileServiceServer) executorv1.FileServiceClient
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.
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) ReadVersion ¶
func (w *Workspace) ReadVersion( ctx context.Context, path string, ) ([]byte, tool.FileVersion, error)
ReadVersion implements tool.Workspace.
func (*Workspace) ReplaceFile ¶
func (w *Workspace) ReplaceFile( ctx context.Context, path string, old tool.FileVersion, data []byte, ) (tool.FileVersion, error)
ReplaceFile implements tool.Workspace.