discovery

package
v0.59.0 Latest Latest
Warning

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

Go to latest
Published: Jan 21, 2025 License: AGPL-3.0 Imports: 13 Imported by: 2

Documentation

Overview

Package discovery implements the discovery service, which lets users surface resource configs for their machines to use.

Index

Constants

View Source
const (
	SubtypeName = "discovery"
)

SubtypeName is the name of the type of service.

Variables

View Source
var API = resource.APINamespaceRDK.WithServiceType(SubtypeName)

API is a variable that identifies the discovery resource API.

View Source
var ErrNilResponse = errors.New("discovery service returned a nil response")

ErrNilResponse is the error for when a nil response is returned from a discovery service.

Functions

func Named

func Named(name string) resource.Name

Named is a helper for getting the named service's typed resource name.

func NewRPCServiceServer

func NewRPCServiceServer(coll resource.APIResourceCollection[Service]) interface{}

NewRPCServiceServer constructs a the discovery gRPC service server. It is intentionally untyped to prevent use outside of tests.

Types

type Service

type Service interface {
	resource.Resource
	DiscoverResources(ctx context.Context, extra map[string]any) ([]resource.Config, error)
}

Service describes the functions that are available to the service.

func FromDependencies

func FromDependencies(deps resource.Dependencies, name string) (Service, error)

FromDependencies is a helper for getting the named discovery service from a collection of dependencies.

func FromRobot

func FromRobot(r robot.Robot, name string) (Service, error)

FromRobot is a helper for getting the named discovery service from the given Robot.

func NewClientFromConn

func NewClientFromConn(
	ctx context.Context,
	conn rpc.ClientConn,
	remoteName string,
	name resource.Name,
	logger logging.Logger,
) (Service, error)

NewClientFromConn constructs a new Client from the connection passed in.

Directories

Path Synopsis
Package fake implements a fake discovery service.
Package fake implements a fake discovery service.
Package register registers all relevant discovery models and also API specific functions
Package register registers all relevant discovery models and also API specific functions

Jump to

Keyboard shortcuts

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