discovery

package
v0.1.0 Latest Latest
Warning

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

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

Documentation

Index

Constants

This section is empty.

Variables

View Source
var (
	ErrDevelopmentPathsRequired = errors.New("backendplugins/discovery: development mode requires explicit paths")
	ErrNoRoots                  = errors.New("backendplugins/discovery: no discovery roots configured")
)

Functions

func UpstreamDefaultRoot

func UpstreamDefaultRoot() string

UpstreamDefaultRoot returns the OS-specific upstream machine default plugin root.

Types

type Config

type Config struct {
	ExplicitPaths           []string
	PackagerRoots           []string
	IncludeUpstreamDefaults bool
	Development             bool
	FS                      FS
	SpawnProbe              SpawnProbe
}

Config configures deterministic non-executing discovery.

type Descriptor

type Descriptor struct {
	SafeID       string
	Root         string
	ManifestPath string
	Manifest     sdkmanifest.Manifest
	Status       Status
	Reason       string
}

Descriptor is an immutable discovery record.

type FS

type FS interface {
	Lstat(name string) (fs.FileInfo, error)
	ReadDir(name string) ([]fs.DirEntry, error)
	Open(name string) (*os.File, error)
}

FS is the minimal filesystem surface discovery needs.

type Result

type Result struct {
	Descriptors []Descriptor
}

Result is the immutable discovery snapshot.

func Discover

func Discover(cfg Config) (Result, error)

Discover scans configured roots for regular *.backendplugin.json manifests. It never launches processes, searches PATH/CWD, or touches the network.

type SpawnProbe

type SpawnProbe interface {
	NoteLaunchAttempt()
}

SpawnProbe is an optional per-Discoverer hook. Production discovery never calls it.

type Status

type Status string

Status is a bounded discovery outcome for one manifest path.

const (
	StatusDiscovered Status = "discovered"
	StatusInvalid    Status = "invalid"
	StatusSkipped    Status = "skipped"
)

Jump to

Keyboard shortcuts

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