unpackage

package
v0.8.0-beta Latest Latest
Warning

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

Go to latest
Published: Oct 30, 2015 License: Apache-2.0 Imports: 13 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

View Source
var (
	ErrOpen           = errors.New("Error opening file")
	ErrRead           = errors.New("Error reading file")
	ErrSeek           = errors.New("Error seeking file")
	ErrCreatingFile   = errors.New("Error creating file")
	ErrCopyingFile    = errors.New("Error copying file")
	ErrUnzip          = errors.New("Error unzipping file")
	ErrReadManifest   = errors.New("Error reading manifest")
	ErrMkdirAll       = errors.New("Error making directory")
	ErrChmod          = errors.New("Error changing file permissions")
	ErrFileRead       = errors.New("Error reading file")
	ErrNoExecFiles    = errors.New("Error no executable files found")
	ErrNext           = errors.New("Error iterating through tar file")
	ErrGetContentType = errors.New("Error getting content type")
	ErrUnmarshalJSON  = errors.New("Error unmarshaling JSON")
	ErrUntar          = errors.New("Error untarring file")
)

Functions

func GetContentType

func GetContentType(path string, file *os.File) (string, error)

Get the content type of the file

func Uncompress

func Uncompress(path string, f *os.File) ([]byte, error)

func Untar

func Untar(path string, reader *bufio.Reader) ([]byte, error)

Untar files and get manifest

func Unzip

func Unzip(path string, f *os.File) (*bufio.Reader, error)

Types

type App

type App struct {
	Exec  []string `json:"exec"`
	Group int64    `json:"group,string"`
	User  int64    `json:"user,string"`
}

type Labels

type Labels struct {
	Name  string `json:"name"`
	Value string `json:"value"`
}

type Manifest

type Manifest struct {
	AcKind    string   `json:"acKind"`
	AcVersion string   `json:"acVersion"`
	Name      string   `json:"name"`
	Labels    []Labels `json:"labels"`
	App       App      `json:"app"`
}

func UnmarshalJSON

func UnmarshalJSON(data []byte) (*Manifest, error)

Unmarshal ACI manifest

func Unpackager

func Unpackager(path string) (string, *Manifest, error)

If package is an ACI, Untar package and Unmarshal ACI manifest

Jump to

Keyboard shortcuts

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