Documentation ¶
Index ¶
- type MessageQueue
- type PubSubData
- type PubSubQueue
- func (pubsubqueue *PubSubQueue) Close() error
- func (pubsubqueue *PubSubQueue) GetResult(ctx context.Context, result *goPubSub.PublishResult) (string, error)
- func (pubsubqueue *PubSubQueue) Init(pubSubKey string, gProject string) error
- func (pubsubqueue *PubSubQueue) Publish(topicName string, pubSubData *PubSubData) *goPubSub.PublishResult
- func (pubsubqueue *PubSubQueue) SubscribeMessages(ctx context.Context, subscriptionId string, ...) error
- type SubscribeFunction
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
This section is empty.
Types ¶
type MessageQueue ¶
type MessageQueue interface { Init(pubSubKey string, gProject string) error Close() error Publish(string, *PubSubData) *goPubSub.PublishResult GetResult(ctx context.Context, result *goPubSub.PublishResult) (string, error) SubscribeMessages(ctx context.Context, subscriptionId string, subscribeFunction SubscribeFunction) error }
MessageQueue Intergace to the wrappers around Google pubsub lib calls
func NewMessageQueue ¶
func NewMessageQueue(enabled bool, serviceAccountKey string, project string) MessageQueue
NewMessageQueue create a new object to MessageQueue interface
type PubSubData ¶
PubSubData represents msg format to be used for writing messages to pubsub
type PubSubQueue ¶
PubSubQueue Required configs for interacting with pubsub
func (*PubSubQueue) Close ¶
func (pubsubqueue *PubSubQueue) Close() error
Close Closes all topic connections to pubsub
func (*PubSubQueue) GetResult ¶
func (pubsubqueue *PubSubQueue) GetResult(ctx context.Context, result *goPubSub.PublishResult) (string, error)
GetResult gets results of the publish call, can be used to make publish a sync call
func (*PubSubQueue) Init ¶
func (pubsubqueue *PubSubQueue) Init(pubSubKey string, gProject string) error
Init initiates connection to Google Pubsub
func (*PubSubQueue) Publish ¶
func (pubsubqueue *PubSubQueue) Publish(topicName string, pubSubData *PubSubData) *goPubSub.PublishResult
Publish publishes the given message to the topic
func (*PubSubQueue) SubscribeMessages ¶
func (pubsubqueue *PubSubQueue) SubscribeMessages(ctx context.Context, subscriptionId string, subscribeFunction SubscribeFunction) error
SubscribeMessages Initales a subscriber call and assigns to given subscriber function
Click to show internal directories.
Click to hide internal directories.