fs

package
v0.0.0-...-e046750 Latest Latest
Warning

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

Go to latest
Published: Nov 26, 2024 License: BSD-3-Clause Imports: 5 Imported by: 0

Documentation

Overview

Package fs provides a backend-agnostic filesystem layer for storing performance results.

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type FS

type FS interface {
	// NewWriter returns a Writer for a given file name.
	// When the Writer is closed, the file will be stored with the
	// given metadata and the data written to the writer.
	NewWriter(ctx context.Context, name string, metadata map[string]string) (Writer, error)
}

An FS stores uploaded benchmark data files.

type MemFS

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

MemFS is an in-memory filesystem implementing the FS interface.

func NewMemFS

func NewMemFS() *MemFS

NewMemFS constructs a new, empty MemFS.

func (*MemFS) Files

func (fs *MemFS) Files() []string

Files returns the names of the files written to fs.

func (*MemFS) NewWriter

func (fs *MemFS) NewWriter(_ context.Context, name string, metadata map[string]string) (Writer, error)

NewWriter returns a Writer for a given file name. As a side effect, it associates the given metadata with the file.

type Writer

type Writer interface {
	io.WriteCloser
	// CloseWithError cancels the writing of the file, removing
	// any partially written data.
	CloseWithError(error) error
}

A Writer is an io.Writer that can also be closed with an error.

Directories

Path Synopsis
Package gcs implements the fs.FS interface using Google Cloud Storage.
Package gcs implements the fs.FS interface using Google Cloud Storage.
Package local implements the fs.FS interface using local files.
Package local implements the fs.FS interface using local files.

Jump to

Keyboard shortcuts

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