discovery

package
v0.2.30 Latest Latest
Warning

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

Go to latest
Published: Mar 27, 2023 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 of primitives, a 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 {
	API   resource.Subtype
	Model resource.Model
}

Query is a tuple of subtype (api) and model used to lookup discovery functions.

func NewQuery

func NewQuery(subtype resource.Subtype, model resource.Model) 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