barrow

package
v3.1.0 Latest Latest
Warning

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

Go to latest
Published: Sep 1, 2024 License: MIT Imports: 33 Imported by: 0

Documentation

Index

Constants

View Source
const (
	Store   uint16 = 0   // no compression
	Deflate uint16 = 8   // DEFLATE compressed
	BZIP2   uint16 = 12  // bzip2
	LZMA    uint16 = 14  // LZMA
	ZSTD    uint16 = 93  // see https://pkware.cachefly.net/webdocs/casestudies/APPNOTE.TXT.
	XZ      uint16 = 95  // XZ
	BROTLI  uint16 = 121 // private
)

Variables

This section is empty.

Functions

func AsExplicitRelativePath

func AsExplicitRelativePath(path string) string

As relative path converts a path to an explicitly relative path starting with a dot (e.g. it converts /foo -> ./foo and foo -> ./foo).

func AsRelativePath

func AsRelativePath(path string) string

AsRelativePath converts a path to a relative path without a "./" prefix. This function leaves trailing slashes to indicate that the path refers to a directory, and converts the path to Unix path.

func LoadMetadata

func LoadMetadata(file string, v any) error

func NormalizeAbsoluteDirPath

func NormalizeAbsoluteDirPath(path string) string

normalizeFirPath is linke NormalizeAbsoluteFilePath with a trailing slash.

func NormalizeAbsoluteFilePath

func NormalizeAbsoluteFilePath(src string) string

NormalizeAbsoluteFilePath returns an absolute cleaned path separated by slashes.

func ToNixPath

func ToNixPath(path string) string

ToNixPath converts the given path to a nix-style path.

Windows-style path separators are considered escape characters by some libraries, which can cause issues.

Types

type BarrowCtx

type BarrowCtx struct {
	CWD         string
	Out         string
	Target      string
	Arch        string
	Release     string
	Destination string
	Pack        []string // supported: zip, tar, sh, rpm
	Compression string
	Verbose     bool
	// contains filtered or unexported fields
}

func (*BarrowCtx) Cleanup

func (b *BarrowCtx) Cleanup(force bool) error

func (*BarrowCtx) DbgPrint

func (b *BarrowCtx) DbgPrint(format string, a ...any)

func (*BarrowCtx) ExpandEnv

func (b *BarrowCtx) ExpandEnv(s string) string

func (*BarrowCtx) Getenv

func (b *BarrowCtx) Getenv(key string) string

func (*BarrowCtx) Initialize

func (b *BarrowCtx) Initialize(ctx context.Context) error

func (*BarrowCtx) LoadCrate

func (b *BarrowCtx) LoadCrate(location string) (*Crate, error)

func (*BarrowCtx) LoadPackage

func (b *BarrowCtx) LoadPackage(cwd string) (*Package, error)

func (*BarrowCtx) LookupEnv

func (b *BarrowCtx) LookupEnv(key string) (string, bool)

func (*BarrowCtx) MakeResources

func (b *BarrowCtx) MakeResources(e *Crate) (WinResCloser, error)

func (*BarrowCtx) Run

func (b *BarrowCtx) Run(ctx context.Context) error

type Crate

type Crate struct {
	Name        string   `toml:"name"`
	Description string   `toml:"description,omitempty"`
	Destination string   `toml:"destination,omitempty"`
	GoFlags     []string `toml:"goflags,omitempty"`
	Version     string   `toml:"version,omitempty"`
	Alias       []string `toml:"alias,omitempty"` // with out suffix
	// contains filtered or unexported fields
}

type FileItem

type FileItem struct {
	Path        string `toml:"path"`
	Destination string `toml:"destination"`
	Rename      string `toml:"rename,omitempty"`      // when rename is no empty: rename file to name
	Permissions string `toml:"permissions,omitempty"` // 0755 0644
}

type FnCompressor

type FnCompressor func(w io.Writer) (io.WriteCloser, error)

type Package

type Package struct {
	Name        string      `toml:"name"`
	PackageName string      `toml:"package-name,omitempty"`
	Summary     string      `toml:"summary,omitempty"`     // Is a short description of the software
	Description string      `toml:"description,omitempty"` // description is a longer piece of software information than Summary, consisting of one or more paragraphs
	Version     string      `toml:"version,omitempty"`
	Authors     []string    `toml:"authors,omitempty"`
	Vendor      string      `toml:"vendor,omitempty"`
	Maintainer  string      `toml:"maintainer,omitempty"`
	Homepage    string      `toml:"homepage,omitempty"`
	Packager    string      `toml:"packager,omitempty"` // BALI_RPM_PACKAGER
	Group       string      `toml:"group,omitempty"`
	License     string      `toml:"license,omitempty"`
	LicenseFile string      `toml:"license-file,omitempty"`
	Prefix      string      `toml:"prefix,omitempty"` // install prefix: rpm required
	Crates      []string    `toml:"crates,omitempty"`
	Include     []*FileItem `toml:"include,omitempty"`
}

type WinResCloser

type WinResCloser func()

Jump to

Keyboard shortcuts

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