Documentation ¶
Index ¶
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
This section is empty.
Types ¶
type Client ¶
type Client interface { ChanSubscribe(subj string, ch chan *nats.Msg) (*nats.Subscription, error) Publish(subj string, data []byte) error }
Client is the client used for NATS connections.
type Hub ¶
type Hub struct {
// contains filtered or unexported fields
}
Hub implements event.notifier and event.subscriber interfaces with a NATS pubsub implementation. The Hub needs to be started using Run.
func (*Hub) NotifyDiceRollCreated ¶
NotifyDiceRollCreated satisfies event.Notifier interface by pusblishing the event in a NATS pubsub stream, serialized in JSON.
type HubConfig ¶
type HubConfig struct { // NATSClient is the client to connect to NATS server. NATSClient Client // Ctx is used to control the event loop, when the context is done, // the Hub will stop subscriptions and event handling and a new Hub is required. Ctx context.Context // Logger is the logger. Logger log.Logger }
HubConfig is the hub configuration.
Click to show internal directories.
Click to hide internal directories.