txtar

package
v0.2.1 Latest Latest
Warning

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

Go to latest
Published: Jun 12, 2022 License: BSD-3-Clause Imports: 5 Imported by: 0

Documentation

Overview

Package txtar provides a simple write-only filesystem based on the txtar archive format.

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type FileSystem

type FileSystem struct {
	// Output is the destination of the filesystem
	// when the Flush method is called. If Output
	// is nil, data is written to os.Stdout.
	Output io.Writer
	// contains filtered or unexported fields
}

FileSystem is a write-only filesystem based on the txtar text archive format provided by golang.org/x/tools/txtar.

func (*FileSystem) Flush

func (fs *FileSystem) Flush() error

Flush writes all closed io.Writers to the FileSystem's Output or os.Stdout if Output is nil. The files in the txtar are sorted lexically by name.

func (*FileSystem) Open

func (fs *FileSystem) Open(path string) (io.WriteCloser, error)

Open returns a new io.WriteCloser file whose writes will added to the txtar output of the Filesystem with the given path. Writes to the file are buffered until the Flush method is called. The file must be closed before calling Flush.

Jump to

Keyboard shortcuts

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