Documentation ¶
Index ¶
Constants ¶
This section is empty.
Variables ¶
View Source
var LogDebug func(message string, a ...interface{}) = func(message string, a ...interface{}) {}
LogDebug represents log function for the websocket
View Source
var LogError func(message string, a ...interface{}) = func(message string, a ...interface{}) {}
LogError represents log function
Functions ¶
This section is empty.
Types ¶
type Adapter ¶
type Adapter interface { OnIncoming(...func(message interface{})) // listening to incoming messages from the outer world OnOutgoing(...func(message interface{})) // listening on outgoing messages OnClose(...func(reason string)) // listening to close event SendOut(message interface{}) error // sending outgoing messages Close(reason string) // closing remote connection }
Adapter represents interface used by the
func NewWsAdapter ¶
NewWsAdapter is a constructor of ws adapter
type Bus ¶
type Bus struct {
// contains filtered or unexported fields
}
Bus represents event bus
func (*Bus) Register ¶
func (b *Bus) Register(handler Adapter) (result *BusRegistration)
Register register handler against set of topics
type BusRegistration ¶
type BusRegistration struct {
// contains filtered or unexported fields
}
BusRegistration is returned by the Bus and exposes additional setters
func (*BusRegistration) ListenTopics ¶
func (r *BusRegistration) ListenTopics(topicIDs ...string) *BusRegistration
ListenTopics sets handler to listen on specific topics
func (*BusRegistration) PublishTopics ¶
func (r *BusRegistration) PublishTopics(topicIDs ...string) *BusRegistration
PublishTopics sets handler to publish to specific topics
Click to show internal directories.
Click to hide internal directories.