Documentation ¶
Index ¶
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
This section is empty.
Types ¶
type PubSubService ¶
type PubSubService interface { Start(appCtx context.Context, mongoDatabase *mongo.Database) error Stop() Publish(tenantId string, topic string, data []byte) error Subscribe(tenantId string, topic string, handler SubscribeHandler) SubscribeKey Unsubscribe(subscribeKey SubscribeKey) Unsubscribes(subscribeKeys []SubscribeKey) }
func New ¶
func New(peerService peer_service.PeerService) PubSubService
type SubscribeContext ¶
type SubscribeContext struct {
// contains filtered or unexported fields
}
type SubscribeHandler ¶
type SubscribeHandler func(tenantId string, topic string, data []byte, subscribeKey SubscribeKey) error
type SubscribeHandlerMap ¶
type SubscribeHandlerMap map[SubscribeKey]SubscribeHandler
type SubscribeKey ¶
type SubscribeKey string
func NewSubscribeKey ¶
func NewSubscribeKey() SubscribeKey
type SubscriberDocument ¶
type SubscriberDocument struct { Id primitive.ObjectID `bson:"_id,omitempty"` TenantId string `bson:"tenantId"` Topic string `bson:"topic"` PeerId string `bson:"peerId"` HeartbeatAt time.Time `bson:"heartbeatAt"` }
func (*SubscriberDocument) GetId ¶
func (d *SubscriberDocument) GetId() string
func (*SubscriberDocument) TopicKey ¶
func (d *SubscriberDocument) TopicKey() TopicKey
Click to show internal directories.
Click to hide internal directories.