pkg

package
v0.1.0 Latest Latest
Warning

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

Go to latest
Published: Oct 22, 2020 License: GPL-3.0 Imports: 10 Imported by: 0

Documentation

Index

Constants

View Source
const (
	FileExt = "pkg"
)

FileExt is the extension for package files

Variables

This section is empty.

Functions

func GetFileName

func GetFileName(name, version, os, arch string, pkgType Type) (string, error)

GetFileName return package file name corresponding to given information

func GetName

func GetName(importPath string, isSrc bool) string

GetName translate from importPath to package name

func Read

func Read(path string) (map[string][]byte, error)

Read reads a package and returns content.

func Write

func Write(path string, files []Entry, overwrite bool) error

Write creates a tar file from a set of ArchiveEntries.

Types

type Entry

type Entry struct {
	FilePath    string
	ArchivePath string
}

Entry is a tiny struct to contain data for a specific entry that will be archived into a pkg file.

func CreateEntries

func CreateEntries(path string, pathPrefix string, excludedFiles []string) ([]Entry, error)

CreateEntries creates a slice with all files in a specific directory that should be added to the archive. The resulting value is a Entry, which maps a filepath to an archive path.

type Type

type Type string

Type represent a package type

const (
	// Control are package used to build source & binary
	Control Type = "control"
	// Source are package providing Go source code
	Source Type = "source"
	// Binary are package providing executable
	Binary Type = "binary"
)

func ParseFileName

func ParseFileName(fileName string) (string, string, string, string, Type, error)

ParseFileName extract package information from file name

Jump to

Keyboard shortcuts

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