surveyor

package
v0.167.0 Latest Latest
Warning

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

Go to latest
Published: Nov 6, 2026 License: Apache-2.0 Imports: 6 Imported by: 1 module, 0 packages

The first number is the count of modules that contain a package that imports this one. The module count is a better indicator of popularity than the package count. A module with 100 importing packages is counted only once instead of 100 times, reflecting the fact that the choice to use the package was likely made only once, not 100 times.
A '?' means that the value hasn't been computed yet.

Documentation

Overview

Package surveyor is the discovery framework: plugins that inspect an environment and return Saga fragments, which are merged so the descriptor can write itself.

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func Apply

func Apply(model *saga.Model, frag saga.Fragment)

Apply merges a fragment into an existing model, upserting components by name.

Delegates to saga.Merge so a surveyor's fragment and a `fragments:` entry go through one merge. Two merges would eventually disagree about what a repeated component name means.

func MergeFragments

func MergeFragments(frags ...saga.Fragment) saga.Fragment

MergeFragments combines fragments into one, deduplicating components by name and unioning each component's surface (repositories, images, hosts, infrastructure).

Whatever a fragment says about a component has to survive the merge, or it may as well not have been said. A proposed exposure travels with the topology it was read from, and the two are only useful together, a value that arrives here without its reason is a guess nobody can check.

Types

type Registry

type Registry struct {
	// contains filtered or unexported fields
}

Registry holds surveyors keyed by name.

func NewRegistry

func NewRegistry() *Registry

NewRegistry returns an empty registry.

func (*Registry) Get

func (r *Registry) Get(name string) (plugin.Surveyor, bool)

Get returns the named surveyor, if registered.

func (*Registry) Names

func (r *Registry) Names() []string

Names returns the registered surveyor names in sorted order.

func (*Registry) Register

func (r *Registry) Register(s plugin.Surveyor)

Register adds a surveyor, keyed by its Info().Name.

func (*Registry) Run

func (r *Registry) Run(ctx context.Context, requests []Request) (saga.Fragment, error)

Run executes each request in order and merges the resulting fragments. Errors (unknown surveyor, survey failure) are collected and returned alongside whatever was discovered.

type Request

type Request struct {
	Surveyor string
	Scope    plugin.SurveyScope
}

Request asks a named surveyor to survey a scope.

Jump to

Keyboard shortcuts

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