Documentation
¶
Index ¶
- type Client
- type Option
- func WithPubSubClient(client pubsubClient) Option
- func WithPublisherByteThreshold(n int) Option
- func WithPublisherCountThreshold(n int) Option
- func WithPublisherDelayThreshold(d time.Duration) Option
- func WithSubscriberMaxDurationPerAckExtension(d time.Duration) Option
- func WithSubscriberMaxExtension(d time.Duration) Option
- func WithSubscriberMaxOutstandingBytes(n int) Option
- func WithSubscriberMaxOutstandingMessages(n int) Option
- func WithSubscriberMinDurationPerAckExtension(d time.Duration) Option
- func WithSubscriberShutdownTimeout(d time.Duration) Option
- type Options
- type WebhookHandler
- func (c *WebhookHandler) Close()
- func (c *WebhookHandler) HandleWebhook(ctx context.Context, topic string, data *types.WebhookCallback, ...) error
- func (c *WebhookHandler) Init(_ context.Context) (*WebhookHandler, error)
- func (c *WebhookHandler) ShouldHandleWebhook(_ context.Context, target string) bool
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
This section is empty.
Types ¶
type Client ¶
type Client struct {
// contains filtered or unexported fields
}
func (*Client) Close ¶
func (c *Client) Close()
Close stops the publisher, flushing any pending messages.
type Option ¶
type Option func(*Options)
func WithPubSubClient ¶
func WithPubSubClient(client pubsubClient) Option
WithPubSubClient sets a custom pubsubClient implementation for testing.
type WebhookHandler ¶
type WebhookHandler struct {
// contains filtered or unexported fields
}
WebhookHandler handles webhook callbacks by publishing them to Pub/Sub topics.
func NewWebhookHandler ¶
func NewWebhookHandler(c *pubsub.Client, isOrdered bool, opts ...Option) *WebhookHandler
func (*WebhookHandler) Close ¶
func (c *WebhookHandler) Close()
Close stops all cached publishers, flushing any pending messages.
func (*WebhookHandler) HandleWebhook ¶
func (c *WebhookHandler) HandleWebhook(ctx context.Context, topic string, data *types.WebhookCallback, logger types.Logger) error
HandleWebhook publishes the webhook callback data to the specified Pub/Sub topic. Callers should use ShouldHandleWebhook to validate the topic name before calling this method.
func (*WebhookHandler) Init ¶
func (c *WebhookHandler) Init(_ context.Context) (*WebhookHandler, error)
func (*WebhookHandler) ShouldHandleWebhook ¶
func (c *WebhookHandler) ShouldHandleWebhook(_ context.Context, target string) bool
Click to show internal directories.
Click to hide internal directories.