archive

package
v0.0.0-...-4489971 Latest Latest
Warning

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

Go to latest
Published: Apr 5, 2024 License: MIT Imports: 1 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

View Source
var ErrFormat = errors.New("archive: unknown format")

ErrFormat is the error returned when archive is asked to get the files from an unkown archive format.

Functions

func RegisterFormat

func RegisterFormat(name string, read func(string) ([]FileData, error), match func(string) bool)

RegisterFormat registers an archive format by mapping its name to a read function and a function that checks if a file is of a specific archive type. It is typically called from an init function in the archive package registering itself.

Types

type FileData

type FileData struct {
	Name string
	Size uint64
}

FileData describes a file in an archive by name and size (uncompressed).

func Read

func Read(name string) ([]FileData, string, error)

Read returns a slice of file data structs for the archive in name and the type of archive, or ErrFormat if the archive type isn't registered.

Directories

Path Synopsis

Jump to

Keyboard shortcuts

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