tarutil

package
v0.0.0-...-870f2d0 Latest Latest
Warning

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

Go to latest
Published: Apr 19, 2024 License: BSD-3-Clause Imports: 4 Imported by: 8

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.

Jump to

Keyboard shortcuts

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