controller

package
v0.0.18 Latest Latest
Warning

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

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

Documentation

Overview

Package controller provides a framework for managing config-driven connectors.

It uses the engine's ControllerService.Reconcile RPC to receive (config, device) matching events, and runs a connector for each 1:1 match.

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func PublishDevice

func PublishDevice(ctx context.Context, entityID string, controllerName string, configurables []*pb.Configurable, labels map[string]string, parent *string) error

PublishDevice emits a device entity with Configurable entries and Labels.

func Run1to1

func Run1to1(ctx context.Context, controllerName string, run RunFunc) error

Run1to1 connects to the engine's Reconcile stream and runs a connector for each (config, device) pair matched by the engine.

Types

type RunFunc

type RunFunc func(ctx context.Context, config *pb.Entity, device *pb.Entity) error

RunFunc is called for each (config, device) match. It should block until done or error. The context is cancelled when the match is removed. On error, it will be restarted with backoff until the context is cancelled.

Jump to

Keyboard shortcuts

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