discovery

package
v0.2.2 Latest Latest
Warning

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

Go to latest
Published: Nov 25, 2022 License: AGPL-3.0 Imports: 3 Imported by: 0

Documentation

Overview

Package discovery implements types to support robot component discovery.

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type Discover

type Discover func(ctx context.Context) (interface{}, error)

Discover is a function that discovers component configurations.

type DiscoverError

type DiscoverError struct {
	Query Query
}

DiscoverError indicates that a Discover function has returned an error.

func (*DiscoverError) Error

func (e *DiscoverError) Error() string

type Discovery

type Discovery struct {
	Query   Query
	Results interface{}
}

Discovery holds a Query and a corresponding discovered component configuration. A discovered component configuration can be comprised primitives, list of primitives, maps with string keys (or at least can be decomposed into one), or lists of the forementioned type of maps. Results with other types of data are not guaranteed.

type Query

type Query struct {
	SubtypeName resource.SubtypeName
	Model       string
}

Query is a tuple of subtype name and model used to lookup discovery functions.

func NewQuery

func NewQuery(subtypeName resource.SubtypeName, model string) Query

NewQuery returns a discovery query for a given subtype and model.

Jump to

Keyboard shortcuts

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