platform

package
v0.24.0 Latest Latest
Warning

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

Go to latest
Published: Jan 9, 2026 License: MIT Imports: 11 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 {
	// Graph graphs all images found on the platform.
	// The graph is published on the channel returned by Graphs.
	// The graph's roots are [ImageNode]s.
	Graph(context.Context) error
	// Graphs 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.
	Graphs() <-chan Graph
	// Close closes the grapher.
	Close() 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 graphs 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

Pin 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) StayBelow added in v0.23.0

func (l Labels) StayBelow() (*semver.Version, error)

StayBelow returns the a semver if the Cupdate stay-below label is set. Returns an error if the value is set, but invalid.

func (Labels) StayOnCurrentMajor added in v0.18.0

func (l Labels) StayOnCurrentMajor() bool

StayOnCurrentMajor 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 {
	// contains filtered or unexported fields
}

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

func NewPollGrapher added in v0.23.0

func NewPollGrapher(grapher Grapher, interval time.Duration) *PollGrapher

func (*PollGrapher) Close added in v0.23.0

func (g *PollGrapher) Close() error

func (*PollGrapher) Graph added in v0.23.0

func (g *PollGrapher) Graph(ctx context.Context) error

Graph implements ContinuousGrapher.

func (*PollGrapher) Graphs added in v0.23.0

func (g *PollGrapher) Graphs() <-chan Graph

Graphs implements ContinuousGrapher.

Directories

Path Synopsis

Jump to

Keyboard shortcuts

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