Documentation
¶
Overview ¶
Package archiver provides an easy way of accessing files inside archives such as tar.gz.
Package archiver provides an easy way of accessing files inside archives such as tar.gz.
Example
package main
import "fmt"
import "os"
import "github.com/erggo/archiver"
func main() {
f, e := os.Open("archive.tar.bz2")
if e != nil {
fmt.Printf("%s \n", e)
return
}
tar := archiver.NewTarBz2(f)
info, e := tar.GetFile("file.xml")
if e != nil {
fmt.Printf("%s \n", e)
return
}
fmt.Printf("%s", info)
}
Index ¶
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
This section is empty.
Types ¶
type Archive ¶
type Archive interface {
WalkAllWithContent(walkFn WalkFunc) error
WalkWithContent(root string, walkFn WalkFunc) error
GetFile(path string) (*bytes.Buffer, error)
}
Archive is a generic interface representing any archive. Supported suffixes right now are: .tgz .tar.gz .tbz, .tbz2 & .tb2 .tar.bz2 TODO suffixes: .taz .tar.Z .tlz .tar.lz & .tar.lzma .txz .tar.xz .zip .rar ???
Click to show internal directories.
Click to hide internal directories.