Documentation ¶
Index ¶
Constants ¶
const (
// ResponseTopicStart prepent to request reply topic to get the response topic
ResponseTopicStart = "mqtt-bridge-response/"
)
Variables ¶
This section is empty.
Functions ¶
This section is empty.
Types ¶
type Channels ¶
type Channels struct {
// contains filtered or unexported fields
}
Channels type to store all channels
func NewChannels ¶
NewChannels function to create a new channel managment
func (*Channels) GetTopic ¶
GetTopic function to get the corresponding MQTT topic to a nats subscription
func (*Channels) RegisterSub ¶
RegisterSub function to register to a MQTT topic to get a mapped nats subject
type Config ¶
type Config struct { MessageChannelsMutex sync.Mutex MessageChannels map[string][]subjectChannelMapping RequestResponseMutex sync.Mutex RequestResponse map[string]chan []byte // contains filtered or unexported fields }
Config type to store configuration
func NewConfig ¶
func NewConfig(basename string, natsConn *nats.Conn, newConfigRegisterChan, newConfigUnregisterChan chan string, pubChan chan paho.Publish) *Config
NewConfig creates a new config containing all channel definitions
func (*Config) GetChannelsForTopic ¶
GetChannelsForTopic returns all go channels that feed the handling routines of all nats subscriptions for a given topic
func (*Config) GetRegistrations ¶
GetRegistrations gets all client registrations for a specific topic
func (*Config) HandleConfigRequests ¶
func (c *Config) HandleConfigRequests()
HandleConfigRequests registeres for configuration requests on the nats server
func (*Config) HandlePublishRequests ¶
func (c *Config) HandlePublishRequests()
HandlePublishRequests register handler for publish requests on the nats server
func (*Config) HandleRequestResponse ¶
func (c *Config) HandleRequestResponse()
HandleRequestResponse register handler for request response on the nats server
type RegisterHandlerConfig ¶
type RegisterHandlerConfig struct { Topic string HandlerFunc paho.MessageHandler }
RegisterHandlerConfig config for registering handler for MQTT topic