Documentation ¶
Overview ¶
Package provider implements pub/sub provider interfaces and registration.
Index ¶
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
func RegisterProvider ¶
func RegisterProvider(p ttnpb.ApplicationPubSub_Provider, implementation Provider)
RegisterProvider registers an implementation for a given pub/sub provider.
Types ¶
type Connection ¶
type Connection struct { Topics UplinkTopics Subscriptions DownlinkSubscriptions ProviderConnection ProviderConnection }
Connection is a wrapper that wraps the topics and subscriptions with a ProviderConnection.
type DownlinkSubscriptions ¶
type DownlinkSubscriptions struct { Push *pubsub.Subscription Replace *pubsub.Subscription }
DownlinkSubscriptions contains the subscriptions for the push and replace queue operations.
type Enabler ¶ added in v3.11.0
type Enabler interface {
Enabled(ctx context.Context, provider ttnpb.ApplicationPubSub_Provider) error
}
Enabler enables providers.
type Provider ¶
type Provider interface {
OpenConnection(ctx context.Context, target Target, enabler Enabler) (*Connection, error)
}
Provider represents a pub/sub service provider.
func GetProvider ¶
GetProvider returns an implementation for a given target.
type ProviderConnection ¶
type ProviderConnection interface { Shutdowner }
ProviderConnection is an interface that represents a provider specific connection.
type Shutdowner ¶
Shutdowner is an interface that contains a contextual shutdown method.
type Target ¶
type Target interface { Topics GetProvider() ttnpb.ApplicationPubSub_Provider }
Target represents settings for a pub/sub provider to connect.
type Topics ¶ added in v3.9.0
type Topics interface { GetBaseTopic() string GetUplinkMessage() *ttnpb.ApplicationPubSub_Message GetUplinkNormalized() *ttnpb.ApplicationPubSub_Message GetJoinAccept() *ttnpb.ApplicationPubSub_Message GetDownlinkAck() *ttnpb.ApplicationPubSub_Message GetDownlinkNack() *ttnpb.ApplicationPubSub_Message GetDownlinkSent() *ttnpb.ApplicationPubSub_Message GetDownlinkFailed() *ttnpb.ApplicationPubSub_Message GetDownlinkQueued() *ttnpb.ApplicationPubSub_Message GetDownlinkQueueInvalidated() *ttnpb.ApplicationPubSub_Message GetLocationSolved() *ttnpb.ApplicationPubSub_Message GetServiceData() *ttnpb.ApplicationPubSub_Message GetDownlinkPush() *ttnpb.ApplicationPubSub_Message GetDownlinkReplace() *ttnpb.ApplicationPubSub_Message }
Topics provide a pub/sub base topic and optional, per-message sub-topics.
type UplinkTopics ¶
type UplinkTopics struct { UplinkMessage *pubsub.Topic UplinkNormalized *pubsub.Topic JoinAccept *pubsub.Topic DownlinkAck *pubsub.Topic DownlinkNack *pubsub.Topic DownlinkSent *pubsub.Topic DownlinkFailed *pubsub.Topic DownlinkQueued *pubsub.Topic DownlinkQueueInvalidated *pubsub.Topic LocationSolved *pubsub.Topic ServiceData *pubsub.Topic }
UplinkTopics contains the topics for the uplink messages.
Directories ¶
Path | Synopsis |
---|---|
Package mock implements a mock pub/sub provider using the mempubsub driver.
|
Package mock implements a mock pub/sub provider using the mempubsub driver. |
Package mqtt implements the MQTT provider using the mqtt driver.
|
Package mqtt implements the MQTT provider using the mqtt driver. |
Package nats implements the NATS provider using the natspubsub driver.
|
Package nats implements the NATS provider using the natspubsub driver. |