perf: golang.org/x/perf/storage/fs Index | Files | Directories

package fs

import "golang.org/x/perf/storage/fs"

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

Index

Package Files

fs.go

type FS Uses

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 Uses

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

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

func NewMemFS Uses

func NewMemFS() *MemFS

NewMemFS constructs a new, empty MemFS.

func (*MemFS) Files Uses

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

Files returns the names of the files written to fs.

func (*MemFS) NewWriter Uses

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 Uses

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

PathSynopsis
gcsPackage gcs implements the fs.FS interface using Google Cloud Storage.
localPackage local implements the fs.FS interface using local files.

Package fs imports 5 packages (graph) and is imported by 8 packages. Updated 2017-09-30. Refresh now. Tools for package owners.