transit

package
v0.1.5 Latest Latest
Warning

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

Go to latest
Published: Nov 24, 2023 License: MIT Imports: 2 Imported by: 0

README

Transport

This module resolves a connection with the supported transporters nucleo has implemented. This helps nodes/services communicate with each other.

Transporter is a message broker that helps two parties communicate with each other.

Supported Transporters

  • TCP

TCP is just for local communication. When you're dealing with just a node.

  • Nats
  • Amqp
  • Kafka
  • Redis

... more to come

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type Transit

type Transit interface {
	Emit(nucleo.BrokerContext)
	Request(nucleo.BrokerContext) chan nucleo.Payload
	Connect() chan error
	Disconnect() chan error
	DiscoverNode(nodeID string)

	//DiscoverNodes checks if there are neighbours and return true if any are found ;).
	DiscoverNodes() chan bool
	SendHeartbeat()
}

type Transport

type Transport interface {
	Connect() chan error
	Disconnect() chan error
	Subscribe(command, nodeID string, handler TransportHandler)
	Publish(command, nodeID string, message nucleo.Payload)

	SetPrefix(prefix string)
	SetNodeID(nodeID string)
	SetSerializer(serializer serializer.Serializer)
}

type TransportHandler

type TransportHandler func(nucleo.Payload)

type ValidateMsgFunc

type ValidateMsgFunc func(nucleo.Payload) bool

Directories

Path Synopsis

Jump to

Keyboard shortcuts

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