manifest

package
v0.0.0-...-be2ef80 Latest Latest
Warning

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

Go to latest
Published: Nov 21, 2024 License: Apache-2.0 Imports: 15 Imported by: 11

Documentation

Index

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 GetMinimumCurrentManifestVersion

func GetMinimumCurrentManifestVersion(ctx context.Context, version, channel, versionsPath string, optionalURL ...string) (compVersion string, err error)

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

func IsCompareSemVersions(v1, v2 string) bool

isCompareSemVersions return true if v1 is less than or equal to v2

func IsSemVersionFmt

func IsSemVersionFmt(version string) (string, bool)

isSemVersionFmt checks the provided version is in semantic version format, if yes, will return the major version

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

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)

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

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