Documentation ¶
Index ¶
- Variables
- type Bridge
- func (b *Bridge) Debug(message string, args ...interface{})
- func (b *Bridge) Error(message string, args ...interface{})
- func (b *Bridge) HandleIncomingCall(topic string, data []byte) ([]byte, error)
- func (b *Bridge) Info(message string, args ...interface{})
- func (b *Bridge) MessageBusInstance() *MessageBus
- func (b *Bridge) PublishExternally(topic string, data []byte) error
- func (b *Bridge) RegisterService(name string, service interface{})
- func (b *Bridge) RequestExternally(timeoutMS int, topic string, data []byte, cb func(m *Message)) (string, error)
- func (b *Bridge) ServiceInstance(name string) interface{}
- func (b *Bridge) Warn(message string, args ...interface{})
- type ExternalPublisher
- type LogLevel
- type Logger
- type Message
- type MessageBus
- func (b *MessageBus) Publish(topic string, data []byte) ([]byte, error)
- func (b *MessageBus) Subscribe(topic string, h MessageHandler) uint64
- func (b *MessageBus) SubscribeAsync(topic string, h MessageHandler, transactional bool) uint64
- func (b *MessageBus) SubscribeOnce(topic string, h MessageHandler) uint64
- func (b *MessageBus) SubscribeOnceAsync(topic string, h MessageHandler) uint64
- func (b *MessageBus) SubscribeTransactional(topic string, h MessageHandler) uint64
- func (b *MessageBus) Unsubscribe(topic string, subscriptionID uint64)
- type MessageHandler
Constants ¶
This section is empty.
Variables ¶
var BridgeVersion string
BridgeVersion exists so you can stamp the compiled artifact with a version number that logs when it is loaded
Functions ¶
This section is empty.
Types ¶
type Bridge ¶
type Bridge struct {
// contains filtered or unexported fields
}
Bridge represents the communication layer between your C++ code and the go components you implement in your project
func (*Bridge) HandleIncomingCall ¶
HandleIncomingCall receives a message from the C++ code and passes it off to the Message Bus where it will returrn the data received from the Message Bus.
func (*Bridge) MessageBusInstance ¶
func (b *Bridge) MessageBusInstance() *MessageBus
func (*Bridge) PublishExternally ¶
PublishExternally is used in a "fire and forget" scenario where you want to publish a message from your go components to your bridge for consumption by the application platform.
func (*Bridge) RegisterService ¶
Register your service with the bridge so that others can get a handle to it
func (*Bridge) RequestExternally ¶
func (b *Bridge) RequestExternally(timeoutMS int, topic string, data []byte, cb func(m *Message)) (string, error)
RequestExternally is used when you want to publish a message from your go components to the application platform and you expect the application platform to send back a response within a specific time limit specified in milliseconds. This will return the unique message ID assigned to your request that is used for the single use Message Bus subscription to the message. This only returns an error if the message could not be published to the application platform.
func (*Bridge) ServiceInstance ¶
Ask the bridge to give you an instance of a service
type ExternalPublisher ¶
type Logger ¶
type MessageBus ¶
func NewMessageBus ¶
func NewMessageBus() *MessageBus
func (*MessageBus) Publish ¶
func (b *MessageBus) Publish(topic string, data []byte) ([]byte, error)
func (*MessageBus) Subscribe ¶
func (b *MessageBus) Subscribe(topic string, h MessageHandler) uint64
func (*MessageBus) SubscribeAsync ¶
func (b *MessageBus) SubscribeAsync(topic string, h MessageHandler, transactional bool) uint64
Transactional means we only allow one at a time to your handler
func (*MessageBus) SubscribeOnce ¶
func (b *MessageBus) SubscribeOnce(topic string, h MessageHandler) uint64
Handler unsubscribed automatically
func (*MessageBus) SubscribeOnceAsync ¶
func (b *MessageBus) SubscribeOnceAsync(topic string, h MessageHandler) uint64
func (*MessageBus) SubscribeTransactional ¶
func (b *MessageBus) SubscribeTransactional(topic string, h MessageHandler) uint64
func (*MessageBus) Unsubscribe ¶
func (b *MessageBus) Unsubscribe(topic string, subscriptionID uint64)