xtar

package
v0.25.15 Latest Latest
Warning

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

Go to latest
Published: Apr 21, 2024 License: Apache-2.0 Imports: 8 Imported by: 0

README

GoKit - xtar

Tar kits for Golang development.

Installation

go get -u github.com/likexian/gokit

Importing

import (
    "github.com/likexian/gokit/xtar"
)

Documentation

Visit the docs on GoDoc

Example

create a tar with gzip compress
err := xtar.Create("likexian.tar.gz", "xtar.go", "xtar_test.go")
if err != nil {
    fmt.Println("Create tar error:", err)
}
Extract a tar with gzip compress
err := xtar.Extract("likexian.tar.gz", "tmp")
if err != nil {
    fmt.Println("Extract tar error:", err)
}

License

Copyright 2012-2024 Li Kexian

Licensed under the Apache License 2.0

Donation

If this project is helpful, please share it with friends.

If you want to thank me, you can give me a cup of coffee.

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func Author

func Author() string

Author returns package author

func Create

func Create(tarFile string, files ...string) (err error)

Create compress a list of files

func Extract

func Extract(tarFile, dstFolder string) (err error)

Extract decompress a tar file to folder

func IsGzName

func IsGzName(name string) bool

IsGzName returns is a tar.gz file name

func License

func License() string

License returns package license

func Version

func Version() string

Version returns package version

Types

This section is empty.

Jump to

Keyboard shortcuts

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