ctrl

package
v0.4.2 Latest Latest
Warning

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

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

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type Command

type Command struct {
	Cmd  string            `json:"cmd"`  // e.g., "conn.close"
	Args map[string]string `json:"args"` // e.g., {"conn_id": "123", "reason": "timeout"}
	Src  string            `json:"src"`  // e.g., "codec_iso8583"
}

Command matches the JSON schema defined in ADR 0020.

type ControlPlane

type ControlPlane interface {
	// Publish sends a command to a specific target gear.
	Publish(targetGearID string, cmd Command) error

	// Subscribe listens for commands targeting this gear.
	Subscribe(myGearID string) (<-chan Command, error)
}

ControlPlane defines the interface for signaling.

type NATSControlPlane

type NATSControlPlane struct {
	// contains filtered or unexported fields
}

NATSControlPlane implements ControlPlane using NATS.

func NewNATSControlPlane

func NewNATSControlPlane(nc *nats.Conn) *NATSControlPlane

NewNATSControlPlane creates a new instance.

func (*NATSControlPlane) Publish

func (cp *NATSControlPlane) Publish(targetGearID string, cmd Command) error

Publish sends a command to "flux.ctrl.{targetGearID}".

func (*NATSControlPlane) Subscribe

func (cp *NATSControlPlane) Subscribe(myGearID string) (<-chan Command, error)

Subscribe listens on "flux.ctrl.{myGearID}" and returns a channel of Commands.

Jump to

Keyboard shortcuts

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