README

Go Reference

golang.org/x/build/tarutil

Package tarutil contains utilities for working with tar archives.

Documentation

Overview

Package tarutil contains utilities for working with tar archives.

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type FileList

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

FileList is a list of entries in a tar archive which acts as a template to make .tar.gz io.Readers as needed.

The zero value is a valid empty list.

All entries must be added before calling OpenTarGz.

func (*FileList) AddHeader

func (fl *FileList) AddHeader(h *tar.Header)

AddHeader adds a non-regular file to the FileList.

func (*FileList) AddRegular

func (fl *FileList) AddRegular(h *tar.Header, size int64, content io.ReaderAt)

AddRegular adds a regular file to the FileList.

func (*FileList) TarGz

func (fl *FileList) TarGz() io.ReadCloser

TarGz returns an io.ReadCloser of a gzip-compressed tar file containing the contents of the FileList. All Add calls must happen before OpenTarGz is called. Callers must call Close on the returned ReadCloser to release resources.

Source Files