Documentation
¶
Index ¶
- Constants
- func AsExplicitRelativePath(path string) string
- func AsRelativePath(path string) string
- func LoadMetadata(file string, v any) error
- func NormalizeAbsoluteDirPath(path string) string
- func NormalizeAbsoluteFilePath(src string) string
- func ToNixPath(path string) string
- type BarrowCtx
- func (b *BarrowCtx) Cleanup(force bool) error
- func (b *BarrowCtx) ExpandEnv(s string) string
- func (b *BarrowCtx) Getenv(key string) string
- func (b *BarrowCtx) Initialize(ctx context.Context) error
- func (b *BarrowCtx) LoadCrate(location string) (*Crate, error)
- func (b *BarrowCtx) LoadPackage(cwd string) (*Package, error)
- func (b *BarrowCtx) LookupEnv(key string) (string, bool)
- func (b *BarrowCtx) MakeResources(e *Crate) (WinResCloser, error)
- func (b *BarrowCtx) Run(ctx context.Context) error
- type Crate
- type FileItem
- type FnCompressor
- type Package
- type WinResCloser
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 ¶
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 ¶
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 NormalizeAbsoluteDirPath ¶
normalizeFirPath is linke NormalizeAbsoluteFilePath with a trailing slash.
func NormalizeAbsoluteFilePath ¶
NormalizeAbsoluteFilePath returns an absolute cleaned path separated by slashes.
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) MakeResources ¶
func (b *BarrowCtx) MakeResources(e *Crate) (WinResCloser, 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 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()
Click to show internal directories.
Click to hide internal directories.