tartest

package
v1.0.0 Latest Latest
Warning

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

Go to latest
Published: Aug 13, 2024 License: LGPL-3.0 Imports: 8 Imported by: 0

Documentation

Overview

Package tartest contains helpers for creating tar archives for usage in tests in the archives package.

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func Create

func Create(options ...OptionFn) (io.Reader, error)

Create creates a new tar archive with a single file, file.txt, containing the contents "hello world".

Types

type Container

type Container int
const (
	// ContainerNone denotes no container. This is the default.
	ContainerNone Container = iota
	// ContainerGz is a tar archive compressed with gzip.
	ContainerGz
	// ContainerXz is a tar archive compressed with xz.
	ContainerXz
	// ContainerBz2 is a tar archive compressed with bzip2.
	ContainerBz2
	// ContainerZstd is a tar archive compressed with zstd.
	ContainerZstd
)

type OptionFn

type OptionFn func(*Options)

func WithContainer

func WithContainer(c Container) OptionFn

WithContainer denotes that a specific container should be used when creating the tar archive.

type Options

type Options struct {
	Container Container
}

Jump to

Keyboard shortcuts

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