Documentation ¶
Index ¶
- func GreaterOrEqual(a VersionedArtifact, b VersionedArtifact) bool
- func Ident(p VersionedPackage) string
- func IsFullyQualified(p VersionedPackage) bool
- func ShortIdent(p VersionedPackage) string
- func VersionString(v VersionedArtifact) string
- type HabPkg
- func (p *HabPkg) InstallIdent() string
- func (p *HabPkg) MarshalText() ([]byte, error)
- func (p *HabPkg) Name() string
- func (p *HabPkg) Origin() string
- func (p *HabPkg) Release() string
- func (p *HabPkg) String() string
- func (p *HabPkg) UnmarshalText(text []byte) error
- func (p *HabPkg) Version() string
- type Hart
- func (h *Hart) InstallIdent() string
- func (h *Hart) MarshalText() ([]byte, error)
- func (h *Hart) Name() string
- func (h *Hart) Origin() string
- func (h *Hart) Path() string
- func (h *Hart) Release() string
- func (h *Hart) String() string
- func (h *Hart) Timestamp() int
- func (h *Hart) UnmarshalText(text []byte) error
- func (h *Hart) Version() string
- func (h *Hart) WithName(name string) *Hart
- func (h *Hart) WithOrigin(origin string) *Hart
- type HartDir
- type Installable
- type SortableHarts
- type VersionedArtifact
- type VersionedPackage
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
func GreaterOrEqual ¶
func GreaterOrEqual(a VersionedArtifact, b VersionedArtifact) bool
GreaterOrEqual returns true if VersionedArtifact fully qualified version is greater or equal to b. It assumes Version() and Release() return lexically sortable strings.
func Ident ¶
func Ident(p VersionedPackage) string
Ident returns the path form of a package name as ORIGIN/NAME or ORIGIN/NAME/VERSION or ORIGIN/NAME/VERSION/RELEASE
func IsFullyQualified ¶
func IsFullyQualified(p VersionedPackage) bool
IsFullyQualified returns true if both version and release are specified
func ShortIdent ¶
func ShortIdent(p VersionedPackage) string
func VersionString ¶
func VersionString(v VersionedArtifact) string
VersionString (ugh, bad name) returns a string representing the version information available in the VersionedArtifact
Types ¶
type HabPkg ¶
type HabPkg struct {
// contains filtered or unexported fields
}
HabPkg represents a Habitat package that can be installed from either the depot or a file on disk using the hab command line tool.
func FromString ¶
FromString takes a string in the form of ORIGIN/NAME and resturns a HabPkg struct
func FromStrings ¶
FromStrings takes a newline separated list of package identifiers and returns a list of HabPkgs.
func NewWithVersion ¶
NewWithVersion constructs a HabPkg with a version (but no release)
func (*HabPkg) InstallIdent ¶
func (*HabPkg) MarshalText ¶
MarshalText turns a HabPkg into text
func (*HabPkg) UnmarshalText ¶
UnmarshalText can take text and parse a HabPkg
type Hart ¶
type Hart struct {
// contains filtered or unexported fields
}
A Hart represents a hartifact archive on disk.
func HartFromPath ¶
HartFromPath parses a path into a Hart
func (*Hart) InstallIdent ¶
func (*Hart) MarshalText ¶
MarshalText turns a HabPkg into text
func (*Hart) UnmarshalText ¶
UnmarshalText can take text and parse a HabPkg
func (*Hart) WithOrigin ¶
WithOrigin sets the origin of the hartifact
type HartDir ¶
type HartDir struct {
// contains filtered or unexported fields
}
HartDir represents a collection of harts
func NewHartDir ¶
NewHartDir constructs a hartDir for the given path
type Installable ¶
type Installable interface { VersionedPackage InstallIdent() string }
An Installable represents something that can be installed with `hab pkg install`. Currently this includes HabPkgs and Harts.
type SortableHarts ¶
type SortableHarts []Hart
SortableHarts are paths to hartifacts on disk. We expect the files to follow the hartifact naming conventions and sort them by the version and timestamp embedded in the filename.
func (SortableHarts) Len ¶
func (h SortableHarts) Len() int
Implement sort.Interface for sortableHarts allowing us to use the routines in the sort package to do any sorting.
func (SortableHarts) Swap ¶
func (h SortableHarts) Swap(i int, j int)
type VersionedArtifact ¶
VersionedArtifact is an interface for artifacts that use habitat-style VERSION/RELEASE version string
type VersionedPackage ¶
type VersionedPackage interface { Origin() string Name() string VersionedArtifact }
VersionedPackage is an interface to help bridge the gap between HabPkg and Hart.