Documentation ¶
Index ¶
- Variables
- func InstallableFromManifest(m ReleaseManifest, name string) habpkg.Installable
- func VersionedPackageFromManifest(m ReleaseManifest, name string) habpkg.VersionedPackage
- type A2
- type CachingReleaseManifestProvider
- type LocalHartManifestProvider
- type ReleaseManifest
- type ReleaseManifestProvider
Constants ¶
This section is empty.
Variables ¶
var ErrNotFoundInManifest = errors.New("Could not find package in manifest")
ErrNotFoundInManifest indicates a package was not found in the manifest for the given name
var (
NoSuchManifest = errors.New("No such manifest found")
)
Functions ¶
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 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 { Build string `json:"build"` BuildSHA string `json:"build_sha"` Packages []habpkg.HabPkg `json:"packages"` HartOverrides []habpkg.Hart `json:"hart_overrides"` }
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) }
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 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 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