tarch

package
v1.3.19 Latest Latest
Warning

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

Go to latest
Published: Jun 6, 2023 License: MIT Imports: 15 Imported by: 0

Documentation

Overview

Package archive provides common low-level utilities for testing archives

  • Copyright (c) 2018-2021, NVIDIA CORPORATION. All rights reserved.

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func CreateTarWithCustomFiles

func CreateTarWithCustomFiles(tarName string, fileCnt, fileSize int, customFileType, customFileExt string, missingKeys bool) error

func CreateTarWithCustomFilesToWriter

func CreateTarWithCustomFilesToWriter(w io.Writer, fileCnt, fileSize int, customFileType, customFileExt string, missingKeys bool) error

func CreateTarWithRandomFiles

func CreateTarWithRandomFiles(tarName, ext string, fileCnt, fileSize int, duplication bool,
	recordExts []string, randomNames []string) error

CreateTarWithRandomFiles creates tar with specified number of files. Tar is also gzipped if necessary.

func CreateZipWithRandomFiles

func CreateZipWithRandomFiles(zipName string, fileCnt, fileSize int, randomNames []string) error

func GetFileInfosFromTarBuffer

func GetFileInfosFromTarBuffer(buffer bytes.Buffer, gzipped bool) ([]os.FileInfo, error)

GetFileInfosFromTarBuffer returns all file infos contained in buffer which presumably is tar or gzipped tar.

func GetFileInfosFromZipBuffer

func GetFileInfosFromZipBuffer(buffer bytes.Buffer) ([]os.FileInfo, error)

GetFileInfosFromZipBuffer returns all file infos contained in buffer which presumably is zip.

Types

type FileContent

type FileContent struct {
	Name    string
	Ext     string
	Content []byte
}

func GetFilesFromTarBuffer

func GetFilesFromTarBuffer(buffer bytes.Buffer, extension string) ([]FileContent, error)

GetFilesFromTarBuffer returns all file infos contained in buffer which presumably is tar or gzipped tar.

Jump to

Keyboard shortcuts

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