platform

package
v0.22.1 Latest Latest
Warning

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

Go to latest
Published: Sep 13, 2025 License: MIT Imports: 10 Imported by: 0

Documentation

Index

Constants

View Source
const (
	InternalLabelHostArchitecture string = "host-architecture"
	InternalLabelOperatingSystem  string = "host-operating-system"
)

Variables

This section is empty.

Functions

This section is empty.

Types

type CompoundGrapher added in v0.15.0

type CompoundGrapher struct {
	Graphers []Grapher
}

CompoundGrapher creates a graph from one or more Grapher simultaneously.

func (*CompoundGrapher) Graph added in v0.15.0

func (g *CompoundGrapher) Graph(ctx context.Context) (Graph, error)

Graph implements Grapher.

type ContinuousGrapher added in v0.18.0

type ContinuousGrapher interface {
	// GraphContinuously returns a channel which will receive a graph of all
	// images found on the platform whenever the graph changes.
	// The graph's roots are [ImageNode]s.
	GraphContinuously(context.Context) (<-chan Graph, error)
}

Grapher provides asynchronous updates of graphs of resources in a platform.

type Graph

type Graph = *graph.Graph[Node]

Graph is a graph implementation holding [Nodes].

func NewGraph

func NewGraph() Graph

NewGraph returns a new Graph.

type Grapher

type Grapher interface {
	// Graph returns a graph of all images found on the platform.
	// The graph's roots are [ImageNode]s.
	Graph(context.Context) (Graph, error)
}

Grapher provides graphs of resources in a platform.

type ImageNode

type ImageNode struct {
	Reference oci.Reference
}

ImageNode represents a resource common to all platforms - the OCI image.

func (ImageNode) ID

func (n ImageNode) ID() string

ID implements Node.

func (ImageNode) InternalLabels added in v0.20.0

func (n ImageNode) InternalLabels() InternalLabels

InternalLabels implements Node.

func (ImageNode) Labels added in v0.17.0

func (n ImageNode) Labels() Labels

Labels implements Node.

func (ImageNode) String

func (n ImageNode) String() string

String implements Node.

func (ImageNode) Type

func (n ImageNode) Type() string

Type implements Node.

type InternalLabels added in v0.20.0

type InternalLabels map[string]string

InternalLabels holds labels maintained by Cupdate for use by Cupdate.

func (InternalLabels) InternalCupdateArchitecture added in v0.20.0

func (l InternalLabels) InternalCupdateArchitecture() string

func (InternalLabels) InternalCupdateOperatingSystem added in v0.20.0

func (l InternalLabels) InternalCupdateOperatingSystem() string

type Labels added in v0.17.0

type Labels map[string]string

Labels holds labels / annotations found by platform implementations, which map to things like Docker labels or Kubernetes resource annotations.

func (Labels) Ignore added in v0.17.0

func (l Labels) Ignore() bool

Ignore returns true if the Cupdate ignore label is set to true.

func (Labels) Pin added in v0.18.0

func (l Labels) Pin() bool

Ignore returns true if the Cupdate pin label is set to true.

func (Labels) RemoveUnsupported added in v0.18.0

func (l Labels) RemoveUnsupported() Labels

RemoveUnsupported removes unsupported labels.

func (Labels) StayOnCurrentMajor added in v0.18.0

func (l Labels) StayOnCurrentMajor() bool

Ignore returns true if the Cupdate stay-on-current-major label is set to true.

type Node

type Node interface {
	// ID implements [graph.Node].
	ID() string
	// Type returns a type uniquely describing the node.
	Type() string
	// Labels returns labels set on the resource represented by the node.
	Labels() Labels
	// InternalLabels returns labels set by Cupdate.
	InternalLabels() InternalLabels
}

Node is a platform resource represented as a graph node.

type PollGrapher

type PollGrapher struct {
	Grapher  Grapher
	Interval time.Duration
}

PollGrapher is a ContinuousGrapher implementation which polls an underlying Grapher implementation.

func (*PollGrapher) GraphContinuously added in v0.18.0

func (g *PollGrapher) GraphContinuously(ctx context.Context) (<-chan Graph, error)

GraphContinuously implements ContinuousGrapher.

Directories

Path Synopsis

Jump to

Keyboard shortcuts

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