Documentation
¶
Index ¶
- func GetAllVersions(ctx context.Context, channel, versionsPath string, optionalURL ...string) ([]string, error)
- func GetMinimumCurrentManifestVersion(ctx context.Context, version, channel, versionsPath string, ...) (compVersion string, err error)
- func InstallableFromManifest(m ReleaseManifest, name string) habpkg.Installable
- func IsCompareSemVersions(v1, v2 string) bool
- func IsSemVersionFmt(version string) (string, bool)
- func NewCannotParseError(err error) error
- func NewInvalidSchemaError(err error) error
- func NewNoSuchManifestError(err error) error
- func VersionedPackageFromManifest(m ReleaseManifest, name string) habpkg.VersionedPackage
- type A2
- type CachingReleaseManifestProvider
- type CannotParseError
- type InvalidSchemaError
- type LocalHartManifestProvider
- type NoSuchManifestError
- type ReleaseManifest
- type ReleaseManifestProvider
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
func GetAllVersions ¶
func GetAllVersions(ctx context.Context, channel, versionsPath string, optionalURL ...string) ([]string, error)
GetAllVersions gives the list of all released versions of given channel in ascending order of version numbers
func InstallableFromManifest ¶
func InstallableFromManifest(m ReleaseManifest, name string) habpkg.Installable
InstallableFromManifest returns a hart if one was provided for the given service, falling back to the package provided in the manifest If the service is not found, both will be nil
func IsCompareSemVersions ¶
isCompareSemVersions return true if v1 is less than or equal to v2
func IsSemVersionFmt ¶
isSemVersionFmt checks the provided version is in semantic version format, if yes, will return the major version
func NewCannotParseError ¶
func NewInvalidSchemaError ¶
func NewNoSuchManifestError ¶
func VersionedPackageFromManifest ¶
func VersionedPackageFromManifest(m ReleaseManifest, name string) habpkg.VersionedPackage
VersionedPackageFromManifest returns a VersionedPackage from the manifest for the given service. If a hartifact exists, the hartifact is preferred. Returns nil if not found.
Types ¶
type A2 ¶
type A2 struct {
SchemaVersion string `json:"schema_version"`
Build string `json:"build"`
BuildSHA string `json:"build_sha"`
Packages []habpkg.HabPkg `json:"packages"`
HartOverrides []habpkg.Hart `json:"hart_overrides"`
SemVersion string `json:"version"`
MinCompatibleVer string `json:"min_compatible_ver"`
}
An A2 manifest specifies the expected contents of a build
func (*A2) HartForServiceName ¶
HartForServiceName returns a hart for the named service to use as an override
func (*A2) ListPackages ¶
func (*A2) PackageForServiceName ¶
PackageForServiceName returns a Package for the named service
type CachingReleaseManifestProvider ¶
type CachingReleaseManifestProvider interface {
ReleaseManifestProvider
// RefreshManifest forces fetching a new manifest from the given channel
RefreshManifest(ctx context.Context, channel string) (*A2, error)
//GetCompatibleVersion fetches the next compatible version for the given version
GetCompatibleVersion(ctx context.Context, channel, version, versionsPath string) (isMinorAvailable, isMajorAvailable bool,
compVersion string, err error)
}
CachingReleaseManifestProvider caches the manifest entry for a configured amount of time. A refresh can be forced with RefreshManifest
func NewCachingReleaseManifestProvider ¶
func NewCachingReleaseManifestProvider(baseProvider ReleaseManifestProvider, cacheTime time.Duration) CachingReleaseManifestProvider
NewCachingReleaseManifestProvider creates a caching ReleaseManifestProvider
type CannotParseError ¶
type CannotParseError struct {
// contains filtered or unexported fields
}
func (*CannotParseError) Error ¶
func (e *CannotParseError) Error() string
type InvalidSchemaError ¶
type InvalidSchemaError struct {
// contains filtered or unexported fields
}
func (*InvalidSchemaError) Error ¶
func (e *InvalidSchemaError) Error() string
type LocalHartManifestProvider ¶
type LocalHartManifestProvider struct {
// contains filtered or unexported fields
}
A LocalHartManifestProvider can add local harts to the manifest for another manifest provider.
func (*LocalHartManifestProvider) GetCurrentManifest ¶
func (provider *LocalHartManifestProvider) GetCurrentManifest(ctx context.Context, channel string) (*A2, error)
GetCurrentManifest returns a release manifest
func (*LocalHartManifestProvider) GetManifest ¶
type NoSuchManifestError ¶
type NoSuchManifestError struct {
// contains filtered or unexported fields
}
func (*NoSuchManifestError) Error ¶
func (e *NoSuchManifestError) Error() string
type ReleaseManifest ¶
type ReleaseManifest interface {
HartForServiceName(name string) (bool, habpkg.Hart)
PackageForServiceName(name string) (bool, habpkg.HabPkg)
ListPackages() []habpkg.HabPkg
Version() string
SHA() string
}
A ReleaseManifest specifies the expected contents of the build.
type ReleaseManifestProvider ¶
type ReleaseManifestProvider interface {
GetCurrentManifest(ctx context.Context, channel string) (*A2, error)
// GetManifest forces fetching the specified manifest
GetManifest(ctx context.Context, release string) (*A2, error)
}
A ReleaseManifestProvider is something that can return a manifest
func NewLocalHartManifestProvider ¶
func NewLocalHartManifestProvider(baseProvider ReleaseManifestProvider, hartPath string, overrideOrigin string) ReleaseManifestProvider
NewLocalHartManifestProvider creates a LocalHartManifestProvider