prytool

package
v0.0.0-...-84b6e8e Latest Latest
Warning

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

Go to latest
Published: Jul 26, 2019 License: MIT Imports: 7 Imported by: 0

Documentation

Index

Constants

View Source
const SizeStringLen = 20

SizeStringLen represents the expected size of the string containing the binary lenght

Variables

This section is empty.

Functions

func ListBundledFiles

func ListBundledFiles(binLocation string) (map[string]FileInfo, error)

ListBundledFiles returns a map of file path to File information for the files contained in the current stapled binary (or fails)

func RetrieveFile

func RetrieveFile(binLocation string, filePath string) (io.ReadCloser, error)

RetrieveFile will return a read closer for the required file or fail.

Types

type File

type File struct {
	Name     string
	FullPath string
	Size     int64
}

File contains some metadata about a file contained in a bundled tar.

type FileInfo

type FileInfo struct {
	FileInfo os.FileInfo
	FileName string
}

FileInfo contains information about a stapled file.

type Folder

type Folder struct {
	Name     string
	FullPath string
	Files    map[string]*File
	Folders  map[string]*Folder
}

Folder contains some metadata about a folder in a bundled tar.

func ListStructuredFiles

func ListStructuredFiles(binLocation string) (*Folder, error)

ListStructuredFiles returns the root folder of the tar containing all the files and folders below it in a structured manner.

type TarFile

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

TarFile wraps a *tar.Reader and the underlying file so it can be returned as a file handler after seeking the right file in the tar and also provides the ability to close the underlying file.

func (*TarFile) Close

func (t *TarFile) Close() error

Close implements Closer and closes the underlying file to the tar reader.

func (*TarFile) Read

func (t *TarFile) Read(p []byte) (n int, err error)

Read implements io.Reader and allows to fetch one file from a tar as if it was a regular file

Jump to

Keyboard shortcuts

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