extractor

package
v0.0.0-...-6710e5c Latest Latest
Warning

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

Go to latest
Published: Oct 16, 2023 License: Apache-2.0 Imports: 14 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func RpmMeta

func RpmMeta(data *rpm.PackageFile) map[string]interface{}

RpmMeta return rpm metadata as key/value accept rpm headers

Types

type Archive

type Archive int

Archive enum

const (
	//Zip const
	Zip Archive = iota
	//Tar const
	Tar
	//SevenZip const
	SevenZip
	//Deb const
	Deb
	//Rpm const
	Rpm
)

type ArchiveHeader

type ArchiveHeader struct {
	Name          string
	ModTime       int64
	Size          int64
	Sha1          string
	Sha2          string
	PkgMeta       map[string]interface{}
	ArchiveReader io.Reader
}

ArchiveHeader archive headers object

func NewArchiveHeader

func NewArchiveHeader(archiveReader io.Reader, name string, modTime int64, size int64) (*ArchiveHeader, error)

NewArchiveHeader return new archiver header metadata object accept header data return headers metadata object

type Archiver

type Archiver interface {
	Extract(path string) ([]*ArchiveHeader, error)
}

Archiver interface

func New

func New(arc Archive) Archiver

New instantiate new archive

type SevenZipReader

type SevenZipReader struct {
	Archive *archive.Archive
	Size    int
}

SevenZipReader object

func (*SevenZipReader) Read

func (a *SevenZipReader) Read(p []byte) (n int, err error)

Read read 7zip data and check if it valid , accept 7zip byte return error

Directories

Path Synopsis

Jump to

Keyboard shortcuts

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