manifest

package
v0.0.0-...-6794c67 Latest Latest
Warning

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

Go to latest
Published: Aug 24, 2021 License: Apache-2.0 Imports: 6 Imported by: 11

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

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 NewCannotParseError

func NewCannotParseError(err error) error

func NewInvalidSchemaError

func NewInvalidSchemaError(err error) error

func NewNoSuchManifestError

func NewNoSuchManifestError(err error) error

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

func (m *A2) HartForServiceName(name string) (bool, habpkg.Hart)

HartForServiceName returns a hart for the named service to use as an override

func (*A2) ListPackages

func (m *A2) ListPackages() []habpkg.HabPkg

func (*A2) PackageForServiceName

func (m *A2) PackageForServiceName(name string) (found bool, habPkg habpkg.HabPkg)

PackageForServiceName returns a Package for the named service

func (*A2) SHA

func (m *A2) SHA() string

SHA returns the manifest SHA

func (*A2) Version

func (m *A2) Version() string

Version returns the manifest version

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 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

func (provider *LocalHartManifestProvider) GetManifest(ctx context.Context, release string) (*A2, error)

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

Directories

Path Synopsis

Jump to

Keyboard shortcuts

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