packer

package
v1.16.0 Latest Latest
Warning

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

Go to latest
Published: Sep 16, 2022 License: MPL-2.0 Imports: 10 Imported by: 0

Documentation

Overview

Package packer provides extracting archive related syntactic sugar.

* Extract tar.gz content

ctx, cancel := context.WithTimeout(context.Background(), 5*time.Second)
defer cancel()

resp := client.MustGetWithContext(ctx, "https://domain.tld")
defer resp.Body.Close()

packer.Untar(resp.Body, "/path/to/extract")

* Extract zip content

ctx, cancel := context.WithTimeout(context.Background(), 5*time.Second)
defer cancel()

resp := client.MustGetWithContext(ctx, "https://domain.tld")
defer resp.Body.Close()

packer.Unzip(resp.Body, "/path/to/extract")

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func Untar

func Untar(r io.Reader, dir string)

Untar reads the gzip-compressed tar file from reader and writes it into target dir.

func Unzip

func Unzip(r io.Reader, dir string)

Unzip reads the zip-compressed file from reader and writes it into target dir.

Types

This section is empty.

Jump to

Keyboard shortcuts

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