Documentation
¶
Index ¶
- Constants
- func ActivePath() (string, error)
- func Check(ctx context.Context) (UpdateStatus, Config, error)
- func Resolve(ctx context.Context, source Source) (Resolution, Config, error)
- func ResolveCachedArtifact(state ActiveState, reference string) (string, bool, error)
- func SaveActive(state ActiveState) error
- type ActiveState
- type Config
- type Effective
- type EffectivePolicy
- type EffectiveProvider
- type EffectiveValue
- type EnvironmentDefaults
- type PolicyDefault
- type ProviderDefault
- type Reference
- type Resolution
- type Source
- type SourceKind
- type UpdateStatus
Constants ¶
View Source
const ContractVersion = "baseharbor.organization/v1"
Variables ¶
This section is empty.
Functions ¶
func ActivePath ¶
func ResolveCachedArtifact ¶
func ResolveCachedArtifact(state ActiveState, reference string) (string, bool, error)
func SaveActive ¶
func SaveActive(state ActiveState) error
Types ¶
type ActiveState ¶
type ActiveState struct {
Resolution Resolution `json:"resolution"`
Config Config `json:"config"`
}
func LoadActive ¶
func LoadActive() (ActiveState, error)
func LoadActiveOptional ¶
func LoadActiveOptional() (ActiveState, bool, error)
type Config ¶
type Config struct {
APIVersion string `yaml:"apiVersion" json:"api_version"`
Organization string `yaml:"organization" json:"organization"`
Defaults EnvironmentDefaults `yaml:"defaults,omitempty" json:"defaults,omitempty"`
Environments map[string]EnvironmentDefaults `yaml:"environments,omitempty" json:"environments,omitempty"`
Providers map[string]Reference `yaml:"providers,omitempty" json:"providers,omitempty"`
Targets map[string]Reference `yaml:"targets,omitempty" json:"targets,omitempty"`
Stacks map[string]Reference `yaml:"stacks,omitempty" json:"stacks,omitempty"`
Trust map[string]Reference `yaml:"trust,omitempty" json:"trust,omitempty"`
Policies map[string]Reference `yaml:"policies,omitempty" json:"policies,omitempty"`
}
type Effective ¶
type Effective struct {
ContractVersion string `json:"contract_version"`
Organization string `json:"organization"`
Environment string `json:"environment"`
Target *EffectiveValue `json:"target,omitempty"`
Stack *EffectiveValue `json:"stack,omitempty"`
Providers map[string]EffectiveProvider `json:"providers,omitempty"`
Trust map[string]EffectiveValue `json:"trust,omitempty"`
Policies []EffectivePolicy `json:"policies,omitempty"`
Resolution Resolution `json:"resolution"`
}
func ResolveEffective ¶
func ResolveEffective(state ActiveState, environment string) (Effective, error)
type EffectivePolicy ¶
type EffectiveProvider ¶
type EffectiveValue ¶
type EnvironmentDefaults ¶
type EnvironmentDefaults struct {
Target string `yaml:"target,omitempty" json:"target,omitempty"`
Stack string `yaml:"stack,omitempty" json:"stack,omitempty"`
Providers map[string]ProviderDefault `yaml:"providers,omitempty" json:"providers,omitempty"`
Trust map[string]Reference `yaml:"trust,omitempty" json:"trust,omitempty"`
Policies []PolicyDefault `yaml:"policies,omitempty" json:"policies,omitempty"`
}
type PolicyDefault ¶
type ProviderDefault ¶
type Resolution ¶
type Resolution struct {
Source Source `yaml:"source" json:"source"`
ResolvedVersion string `yaml:"resolved-version,omitempty" json:"resolved_version,omitempty"`
ResolvedDigest string `yaml:"resolved-digest,omitempty" json:"resolved_digest,omitempty"`
ResolvedRevision string `yaml:"resolved-revision,omitempty" json:"resolved_revision,omitempty"`
Provenance string `yaml:"provenance,omitempty" json:"provenance,omitempty"`
CachePath string `yaml:"cache-path,omitempty" json:"cache_path,omitempty"`
}
func (Resolution) Validate ¶
func (r Resolution) Validate() error
type Source ¶
type Source struct {
Kind SourceKind `yaml:"kind" json:"kind"`
Location string `yaml:"location" json:"location"`
Requested string `yaml:"requested,omitempty" json:"requested,omitempty"`
}
type SourceKind ¶
type SourceKind string
const ( SourceOCI SourceKind = "oci" SourceGit SourceKind = "git" SourceLocal SourceKind = "local" SourceSystem SourceKind = "system" )
type UpdateStatus ¶
type UpdateStatus struct {
Current Resolution `json:"current"`
Available Resolution `json:"available"`
Changed bool `json:"changed"`
}
Click to show internal directories.
Click to hide internal directories.