Documentation ¶
Index ¶
Constants ¶
const ( DefaultInitialRetryInterval = 50 * time.Millisecond DefaultFlushDelayThreshold = time.Millisecond * 10 DefaultMaxRetryCount int16 = 3 DefaultBatchSize int32 = 1000 )
Variables ¶
This section is empty.
Functions ¶
This section is empty.
Types ¶
type BatchResult ¶
type BatchResult struct {
Results []*BufferedPublishResult
}
BatchResult - result from batch publishing. It contains reference Id to the original message published.
type BufferedPublishResult ¶
BufferedPublishResult - published result.
type BufferedPublisher ¶
type BufferedPublisher interface { Publish(ctx context.Context, topicName string, payloadBatch []messaging.Message) (*BatchResult, error) Close(ctx context.Context) error }
BufferedPublisher - interface for the publisher
func NewBufferedPublisher ¶
func NewBufferedPublisher( client Client, publishConfig TopicPublishConfig) (BufferedPublisher, error)
NewBufferedPublisher - Constructor of BufferedPublisher.
type BufferedPublisherWithRetry ¶
type BufferedPublisherWithRetry interface { Publish(ctx context.Context, topic string, message messaging.Message) error Flush(ctx context.Context) error Close(ctx context.Context) error GetBufferedMessages(topic string) []*messaging.Message }
BufferedPublisherWithRetry - interface for the publisher
func NewBufferedPublisherWithRetry ¶
func NewBufferedPublisherWithRetry( ctx context.Context, client Client, publishConfig TopicPublishConfig) (BufferedPublisherWithRetry, error)
NewBufferedPublisherWithRetry - Constructor.
type Error ¶
type Error struct {
// contains filtered or unexported fields
}
Error - General PubSub Error.
func NewMessagingError ¶
NewMessagingError - NewMessagingError constructor.
func NewMessagingErrorCode ¶
NewMessagingErrorCode - MessagingError constructor given a predefined Error Code.
type PublishResult ¶
PublishResult - PubSub Publish Result wrapper interface.
type Topic ¶
type Topic interface { Publish(ctx context.Context, msg messaging.Message) PublishResult Stop() Flush() String() string ConfigPublishSettings(config TopicPublishConfig) }
Topic - Topic wrapper interface.
type TopicCache ¶
type TopicCache struct { sync.Mutex Cache map[string]*TopicCacheItem }
TopicCache - Topic Cache with mutex access.
type TopicCacheItem ¶
type TopicCacheItem struct {
// contains filtered or unexported fields
}
TopicCacheItem - topic cache item.
func NewTopicCacheItem ¶
func NewTopicCacheItem(topic Topic, initialValue int32) *TopicCacheItem
NewTopicCacheItem -