Help us shape the future of Go! Take the 2026 Go Developer Survey

orgconfig

package
v0.4.19 Latest Latest
Warning

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

Go to latest
Published: Oct 2, 2026 License: Apache-2.0 Imports: 14 Imported by: 0

Documentation

Index

Constants

View Source
const ContractVersion = "baseharbor.organization/v1"

Variables

This section is empty.

Functions

func ActivePath

func ActivePath() (string, error)

func Check

func Check(ctx context.Context) (UpdateStatus, Config, error)

func Resolve

func Resolve(ctx context.Context, source Source) (Resolution, Config, error)

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 Activate

func Activate(ctx context.Context, source Source) (ActiveState, error)

func LoadActive

func LoadActive() (ActiveState, error)

func LoadActiveOptional

func LoadActiveOptional() (ActiveState, bool, error)

func Refresh

func Refresh(ctx context.Context) (ActiveState, 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"`
}

func (Config) Validate

func (c Config) Validate() error

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 EffectivePolicy struct {
	Policy    string `json:"policy"`
	Reference string `json:"reference"`
	Mandatory bool   `json:"mandatory"`
	Source    string `json:"source"`
}

type EffectiveProvider

type EffectiveProvider struct {
	Provider  string `json:"provider"`
	Reference string `json:"reference"`
	Scope     string `json:"scope,omitempty"`
	Source    string `json:"source"`
}

type EffectiveValue

type EffectiveValue struct {
	Name   string `json:"name,omitempty"`
	Value  string `json:"value"`
	Source string `json:"source"`
}

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 PolicyDefault struct {
	Policy    string `yaml:"policy" json:"policy"`
	Mandatory bool   `yaml:"mandatory,omitempty" json:"mandatory,omitempty"`
}

type ProviderDefault

type ProviderDefault struct {
	Provider string `yaml:"provider" json:"provider"`
	Scope    string `yaml:"scope,omitempty" json:"scope,omitempty"`
}

type Reference

type Reference struct {
	Reference string `yaml:"reference" json:"reference"`
}

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"`
}

func (Source) Validate

func (s Source) Validate() error

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"`
}

Jump to

Keyboard shortcuts

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