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

availability

package
v0.4.22 Latest Latest
Warning

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

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

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type Guarantees

type Guarantees struct {
	MemberFailureTolerance bool   `json:"member_failure_tolerance,omitempty"`
	HostFailureTolerance   bool   `json:"host_failure_tolerance,omitempty"`
	RollingMaintenance     bool   `json:"rolling_maintenance,omitempty"`
	CredentialRotation     bool   `json:"credential_rotation,omitempty"`
	PKIRotation            bool   `json:"pki_rotation,omitempty"`
	ManagementContinuity   bool   `json:"management_continuity,omitempty"`
	FailureDomain          string `json:"failure_domain,omitempty"`
}

type Health

type Health string
const (
	Healthy              Health = "healthy"
	Degraded             Health = "degraded"
	Unavailable          Health = "unavailable"
	UnsatisfiedGuarantee Health = "unsatisfied-guarantee"
)

type InstanceObservation

type InstanceObservation struct {
	ID            string `json:"id"`
	Ready         bool   `json:"ready"`
	FailureDomain string `json:"failure_domain,omitempty"`
}

type Intent

type Intent struct {
	HA        bool                `json:"ha"`
	Overrides map[string]Override `json:"overrides,omitempty"`
}

func (Intent) Components

func (i Intent) Components() []string

func (Intent) Resolve

func (i Intent) Resolve(component string) Requirement

func (Intent) Validate

func (i Intent) Validate() error

type NegotiationResult

type NegotiationResult struct {
	Component          string       `json:"component"`
	Provider           string       `json:"provider"`
	RequiredHA         bool         `json:"required_ha"`
	RequestedInstances int          `json:"requested_instances,omitempty"`
	EffectiveInstances int          `json:"effective_instances,omitempty"`
	Support            SupportLevel `json:"support"`
	ExplicitException  bool         `json:"explicit_exception,omitempty"`
	Satisfied          bool         `json:"satisfied"`
	Reason             string       `json:"reason,omitempty"`
	Guarantees         Guarantees   `json:"guarantees,omitempty"`
}

func Negotiate

func Negotiate(requirement Requirement, provider string, support Support) (NegotiationResult, error)

type Override

type Override struct {
	HA        *bool `json:"ha,omitempty"`
	Instances int   `json:"instances,omitempty"`
}

type Requirement

type Requirement struct {
	Component         string `json:"component"`
	HA                bool   `json:"ha"`
	Instances         int    `json:"instances,omitempty"`
	ExplicitException bool   `json:"explicit_exception,omitempty"`
}

type ServiceObservation

type ServiceObservation struct {
	Component       string                `json:"component"`
	StableEndpoints []string              `json:"stable_endpoints,omitempty"`
	Instances       []InstanceObservation `json:"instances"`
	Health          Health                `json:"health"`
	ReadyInstances  int                   `json:"ready_instances"`
}

func Observe

func Observe(requirement Requirement, instances []InstanceObservation, endpoints []string) ServiceObservation

type Support

type Support struct {
	Level                SupportLevel `json:"level"`
	RecommendedInstances int          `json:"recommended_instances,omitempty"`
	Limits               string       `json:"limits,omitempty"`
	Guarantees           Guarantees   `json:"guarantees,omitempty"`
}

func (Support) Validate

func (s Support) Validate() error

type SupportLevel

type SupportLevel string
const (
	Supported          SupportLevel = "SUPPORTED"
	PartiallySupported SupportLevel = "PARTIALLY_SUPPORTED"
	Unsupported        SupportLevel = "UNSUPPORTED"
)

type UnsupportedGuaranteeError

type UnsupportedGuaranteeError struct {
	Result NegotiationResult
}

func (*UnsupportedGuaranteeError) Error

func (e *UnsupportedGuaranteeError) Error() string

Jump to

Keyboard shortcuts

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