func Format(a *Archive) []byte
Format returns the serialized form of an Archive. It is assumed that the Archive data structure is well-formed: a.Comment and all a.File[i].Data contain no file marker lines, and all a.File[i].Name is non-empty.
func NeedsQuote(data []byte) bool
NeedsQuote reports whether the given data needs to be quoted before it's included as a txtar file.
func Quote(data []byte) ([]byte, error)
Quote quotes the data so that it can be safely stored in a txtar file. This copes with files that contain lines that look like txtar separators.
The original data can be recovered with Unquote. It returns an error if the data cannot be quoted (for example because it has no final newline or it holds unprintable characters)
func Unquote(data []byte) ([]byte, error)
Unquote unquotes data as quoted by Quote.
func Write(a *Archive, dir string) error
Write writes each File in an Archive to the given directory, returning any errors encountered. An error is also returned in the event a file would be written outside of dir.
An Archive is a collection of files.
type Archive = txtar.Archive
func Parse(data []byte) *Archive
Parse parses the serialized form of an Archive. The returned Archive holds slices of data.
TODO use golang.org/x/tools/txtar.Parse when https://github.com/golang/go/issues/59264 is fixed.
func ParseFile(file string) (*Archive, error)
ParseFile parses the named file as an archive.
A File is a single file in an archive.
type File = txtar.File