bus

package
v0.0.0-...-ccaa6ab Latest Latest
Warning

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

Go to latest
Published: Jan 30, 2024 License: MIT Imports: 2 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func WithClosedHandler

func WithClosedHandler(fn nats.ConnHandler) func(*BusConn)

func WithDisconnHandler

func WithDisconnHandler(fn nats.ConnErrHandler) func(*BusConn)

func WithReconnHandler

func WithReconnHandler(fn nats.ConnHandler) func(*BusConn)

func WithReconnect

func WithReconnect() func(*BusConn)

Types

type BusConn

type BusConn struct {
	*nats.Conn
	// contains filtered or unexported fields
}

func New

func New(url string, options ...func(*BusConn)) (*BusConn, error)

type MirBus

type MirBus = string
var (
	ConfigStreamName    MirBus = "v1alpha_cfg"
	ConfigStreamSubject MirBus = "v1alpha.*.*.cfg.>"
	// <version>.<device_id>.<model_id>.<cfg|tlm|cmd>.<function>
	// v1alpha.XFEA76,FactoryA.cfg.desired_property
	// Could be <name_of_proto_file>.tlm.<version>
	// There could be a service for each proto
	// start with * for now
	TelemetryStreamName    MirBus = "v1alpha_tlm"
	TelemetryStreamSubject MirBus = "v1alpha.*.*.tlm.>"
	TelemetryConsumerProto MirBus = "v1alpha.*.*.tlm.proto"
	// v1alpha.XFEA76.FactoryA.tlm.proto
	// ProtoMessage in header
	CommandStreamName     MirBus = "v1alpha_cmd"
	CommandsStreamSubject MirBus = "v1alpha.*.*.cmd.>"
)

Jump to

Keyboard shortcuts

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