bridge

package
v0.0.0-...-e4704d8 Latest Latest
Warning

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

Go to latest
Published: Oct 30, 2024 License: Apache-2.0 Imports: 11 Imported by: 0

Documentation

Index

Constants

View Source
const (
	OFFLINE = iota
	ONLINE
)
View Source
const (
	NATS_STOMP_SUBJECT_PREFIX         = "stomp.usp.v1."
	NATS_STOMP_ADAPTER_SUBJECT_PREFIX = "stomp-adapter.usp.v1."
	DEVICE_SUBJECT_PREFIX             = "device.usp.v1."
	STOMP_QUEUE_PREFIX                = "oktopus/usp/v1/"
	STOMP_STATUS_QUEUE                = STOMP_QUEUE_PREFIX + "status"
	DEVICE_TIMEOUT_RESPONSE           = 5 * time.Second
	USP_CONTENT_TYPE                  = "application/vnd.bbf.usp.msg"
)
View Source
const STOMP_CONNECTION_RETRY = 5 * time.Second

Variables

This section is empty.

Functions

This section is empty.

Types

type Bridge

type Bridge struct {
	Pub   Publisher
	Sub   Subscriber
	Stomp config.Stomp
	Ctx   context.Context
}

func NewBridge

func NewBridge(p Publisher, s Subscriber, ctx context.Context, stomp config.Stomp) *Bridge

func (*Bridge) StartBridge

func (b *Bridge) StartBridge()

type Publisher

type Publisher func(string, []byte) error

type Subscriber

type Subscriber func(string, func(*nats.Msg)) error

Jump to

Keyboard shortcuts

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