Documentation
¶
Overview ¶
Package versionbundle provides primitives for dynamic and recursive version management within infrastructures of distributed microservices.
Index ¶
- Constants
- func IsBundleNotFound(err error) bool
- func IsExecutionFailed(err error) bool
- func IsInvalidBundle(err error) bool
- func IsInvalidBundleError(err error) bool
- func IsInvalidBundles(err error) bool
- func IsInvalidBundlesError(err error) bool
- func IsInvalidChangelog(err error) bool
- func IsInvalidComponent(err error) bool
- func IsInvalidConfig(err error) bool
- func IsInvalidRelease(err error) bool
- func NewKind(kindType string) (kind, error)
- func ValidateIndexReleases(indexReleases []IndexRelease) error
- type App
- type AppsChangelogs
- type Authority
- type Bundle
- func CopyBundles(bundles []Bundle) []Bundle
- func GetBundleByName(bundles []Bundle, name string) (Bundle, error)
- func GetBundleByNameForProvider(bundles []Bundle, name, provider string) (Bundle, error)
- func GetNewestBundle(bundles []Bundle) (Bundle, error)
- func GetNewestBundleForProvider(bundles []Bundle, provider string) (Bundle, error)
- type Bundles
- type Changelog
- type Collector
- type CollectorConfig
- type CollectorEndpointResponse
- type Component
- type IndexRelease
- type Release
- type ReleaseConfig
- type ReleasesChangelogs
- type SortBundlesByName
- type SortBundlesByVersion
- type SortComponentsByName
- type SortIndexReleasesByVersion
- type SortReleasesByTimestamp
- type SortReleasesByVersion
- type URL
Constants ¶
const ( // KindAdded is used in changelogs for new features. KindAdded kind = "added" // KindChanged is used in changelogs for changes in existing functionality. KindChanged kind = "changed" // KindDeprecated is used in a changelogs for soon-to-be removed features. KindDeprecated kind = "deprecated" // KindFixed is used in changelogs for any bug fixes. KindFixed kind = "fixed" // KindRemoved is used in changelogs for now removed features. KindRemoved kind = "removed" // KindSecurity is used in chnagelogs in case of vulnerabilities. KindSecurity kind = "security" )
Variables ¶
This section is empty.
Functions ¶
func IsBundleNotFound ¶
IsBundleNotFound asserts bundleNotFoundError.
func IsExecutionFailed ¶
IsExecutionFailed asserts executionFailedError.
func IsInvalidBundle ¶ added in v0.2.0
IsInvalidBundle asserts invalidBundleError.
func IsInvalidBundleError ¶
IsInvalidBundleError asserts invalidBundleError.
func IsInvalidBundles ¶ added in v0.2.0
IsInvalidBundles asserts invalidBundlesError.
func IsInvalidBundlesError ¶
IsInvalidBundlesError asserts invalidBundlesError.
func IsInvalidChangelog ¶
IsInvalidChangelog asserts invalidChangelogError.
func IsInvalidComponent ¶
IsInvalidComponent asserts invalidComponentError.
func IsInvalidConfig ¶
IsInvalidConfig asserts invalidConfigError.
func IsInvalidRelease ¶
IsInvalidRelease asserts invalidReleaseError.
func ValidateIndexReleases ¶
func ValidateIndexReleases(indexReleases []IndexRelease) error
ValidateIndexReleases ensures semantic rules for collection of indexReleases so that when used together, they form consistent and integral release index.
Types ¶
type App ¶
type AppsChangelogs ¶
type Authority ¶
type Bundle ¶
type Bundle struct {
// Changelogs describe what changes are introduced by the version bundle. Each
// version bundle must have at least one changelog entry.
//
// NOTE that once this property is set it must never change again.
Changelogs []Changelog `json:"changelogs" yaml:"changelogs"`
// Components describe the components an authority exposes. Functionality of
// components listed here is guaranteed to be implemented in the according
// versions.
//
// NOTE that once this property is set it must never change again.
Components []Component `json:"components" yaml:"components"`
// Name is the name of the authority exposing the version bundle.
//
// NOTE that once this property is set it must never change again.
Name string `json:"name" yaml:"name"`
// Provider describes infrastructure provider that is specific for this
// Bundle.
Provider string `json:"provider,omitempty" yaml:"provider,omitempty"`
// Version describes the version of the version bundle. Versions of version
// bundles must be semver versions. Versions must not be duplicated. Versions
// should be incremented gradually.
//
// NOTE that once this property is set it must never change again.
Version string `json:"version" yaml:"version"`
}
Bundle represents a single version bundle exposed by an authority. An authority might exposes mutliple version bundles using the Capability structure. Version bundles are aggregated into a merged structure represented by the Aggregation structure. Also see the Aggregate function.
func CopyBundles ¶
func GetNewestBundle ¶
type Bundles ¶
type Bundles []Bundle
Bundles is a plain validation type for a list of version bundles. A list of version bundles is exposed by authorities. Lists of version bundles of multiple authorities are aggregated and grouped to reflect releases.
type Changelog ¶
type Changelog struct {
// Component is the component the changelog is about. Thus might be a
// component provided by another authority. To be able to properly aggregate
// version bundles the given component must exist, either within the same
// authority or within another authority within the infrastructure. That is,
// Aggregate must know about it to be able to properly merge version bundles.
Component string `json:"component,omitempty" yaml:"component,omitempty"`
// ComponentVersion is the upstream version of the exposed component.
ComponentVersion string `json:"componentVersion,omitempty" yaml:"componentVersion,omitempty"`
// Description is some text describing the changelog entry. This information
// is intended to be useful for humans.
Description string `json:"description" yaml:"description"`
// Kind is a machine readable type describing what kind of changelog the
// changelog actually is. Also see the kind type.
Kind kind `json:"kind" yaml:"kind"`
// URLs is a list of links which contain additional information to the
// changelog entry such as upstream changelogs or pull requests.
URLs []string `json:"urls" yaml:"urls"`
// Version is the Giant Swarm version of the component.
Version string `json:"version,omitempty" yaml:"version,omitempty"`
}
Changelog is a single changelog entry a version bundle must define. Its intention is to explain the introduction of the version bundle.
func CopyChangelogs ¶
type Collector ¶
type Collector struct {
// contains filtered or unexported fields
}
func NewCollector ¶
func NewCollector(config CollectorConfig) (*Collector, error)
type CollectorConfig ¶
type CollectorEndpointResponse ¶
type CollectorEndpointResponse struct {
VersionBundles []Bundle `json:"version_bundles"`
}
type Component ¶
type Component struct {
// Name is the name of the exposed component.
Name string `json:"name" yaml:"name"`
// Version is the version of the exposed component.
Version string `json:"version" yaml:"version"`
}
Component is the software component an authority provides. It describes the functionality of such a component being exposed by the authority. In return an authority guarantees to provide the components functionality.
func CopyComponents ¶
type IndexRelease ¶
type Release ¶
type Release struct {
// contains filtered or unexported fields
}
func CompileReleases ¶
func CompileReleases(logger micrologger.Logger, indexReleases []IndexRelease, bundles []Bundle) ([]Release, error)
CompileReleases takes indexReleases and collected version bundles and compiles canonicalized Releases from them.
func GetNewestRelease ¶
func NewRelease ¶
func NewRelease(config ReleaseConfig) (Release, error)
func (Release) Changelogs ¶
func (Release) Components ¶
type ReleaseConfig ¶
type ReleasesChangelogs ¶
type ReleasesChangelogs map[string]AppsChangelogs
type SortBundlesByName ¶
type SortBundlesByName []Bundle
func (SortBundlesByName) Len ¶
func (b SortBundlesByName) Len() int
func (SortBundlesByName) Less ¶
func (b SortBundlesByName) Less(i, j int) bool
func (SortBundlesByName) Swap ¶
func (b SortBundlesByName) Swap(i, j int)
type SortBundlesByVersion ¶
type SortBundlesByVersion []Bundle
func (SortBundlesByVersion) Len ¶
func (b SortBundlesByVersion) Len() int
func (SortBundlesByVersion) Less ¶
func (b SortBundlesByVersion) Less(i, j int) bool
func (SortBundlesByVersion) Swap ¶
func (b SortBundlesByVersion) Swap(i, j int)
type SortComponentsByName ¶
type SortComponentsByName []Component
func (SortComponentsByName) Len ¶
func (c SortComponentsByName) Len() int
func (SortComponentsByName) Less ¶
func (c SortComponentsByName) Less(i, j int) bool
func (SortComponentsByName) Swap ¶
func (c SortComponentsByName) Swap(i, j int)
type SortIndexReleasesByVersion ¶
type SortIndexReleasesByVersion []IndexRelease
func (SortIndexReleasesByVersion) Len ¶
func (r SortIndexReleasesByVersion) Len() int
func (SortIndexReleasesByVersion) Less ¶
func (r SortIndexReleasesByVersion) Less(i, j int) bool
func (SortIndexReleasesByVersion) Swap ¶
func (r SortIndexReleasesByVersion) Swap(i, j int)
type SortReleasesByTimestamp ¶
type SortReleasesByTimestamp []Release
func (SortReleasesByTimestamp) Len ¶
func (r SortReleasesByTimestamp) Len() int
func (SortReleasesByTimestamp) Less ¶
func (r SortReleasesByTimestamp) Less(i, j int) bool
func (SortReleasesByTimestamp) Swap ¶
func (r SortReleasesByTimestamp) Swap(i, j int)
type SortReleasesByVersion ¶
type SortReleasesByVersion []Release
func (SortReleasesByVersion) Len ¶
func (r SortReleasesByVersion) Len() int
func (SortReleasesByVersion) Less ¶
func (r SortReleasesByVersion) Less(i, j int) bool
func (SortReleasesByVersion) Swap ¶
func (r SortReleasesByVersion) Swap(i, j int)