virtualfs

package
v0.12.1 Latest Latest
Warning

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

Go to latest
Published: Oct 1, 2022 License: Apache-2.0 Imports: 8 Imported by: 3

Documentation

Overview

Package virtualfs implements an in-memory abstraction of fs.Directory and fs.StreamingFile.

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func NewStaticDirectory

func NewStaticDirectory(name string, entries []fs.Entry) fs.Directory

NewStaticDirectory returns a virtual static directory.

func NewStreamingDirectory added in v0.11.0

func NewStreamingDirectory(
	name string,
	callback func(context.Context, func(context.Context, fs.Entry) error) error,
) fs.Directory

NewStreamingDirectory returns a directory that will call the given function when IterateEntries is executed.

func StreamingFileFromReader

func StreamingFileFromReader(name string, reader io.Reader) fs.StreamingFile

StreamingFileFromReader returns a streaming file with given name and reader.

func StreamingFileWithModTimeFromReader added in v0.12.0

func StreamingFileWithModTimeFromReader(name string, t time.Time, reader io.Reader) fs.StreamingFile

StreamingFileWithModTimeFromReader returns a streaming file with given name, modified time, and reader.

Types

This section is empty.

Jump to

Keyboard shortcuts

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