Documentation
¶
Index ¶
- Constants
- func MarshallPayloadToJson() middleware.Middleware
- func MetadataAsAttributes(msg *message.Message) map[string]string
- func UnmarshallPayloadFromJson[T any](payloadType T) middleware.Middleware
- type AttributesProvider
- type MessageUnmarshaller
- type OrderingKeyProvider
- type Publisher
- type PublisherOption
- type PublisherOptions
- type PubsubTopic
- type Subscriber
- type SubscriberOption
- func WithParseAttributes(parseAttributes bool) SubscriberOption
- func WithProcessingTimeout(timeout time.Duration) SubscriberOption
- func WithProcessingTimeoutHandler(handler func(ctx context.Context, msg *pubsub.Message)) SubscriberOption
- func WithReceiveSettings(settings pubsub.ReceiveSettings) SubscriberOption
- type SubscriberOptions
Constants ¶
const DefaultProcessingTimeout = 600 * time.Second
Variables ¶
This section is empty.
Functions ¶
func MarshallPayloadToJson ¶
func MarshallPayloadToJson() middleware.Middleware
func UnmarshallPayloadFromJson ¶
func UnmarshallPayloadFromJson[T any](payloadType T) middleware.Middleware
Types ¶
type MessageUnmarshaller ¶
type OrderingKeyProvider ¶
type Publisher ¶
type Publisher struct {
// contains filtered or unexported fields
}
func NewGooglePublisher ¶
func NewGooglePublisher( c *pubsub.Client, routingFunc publisher.RoutingFunc, opts ...PublisherOption) (*Publisher, error)
type PublisherOption ¶
type PublisherOption func(*PublisherOptions)
func WithAttributesProvider ¶
func WithAttributesProvider(provider AttributesProvider) PublisherOption
WithAttributesProvider is a function that returns attributes for a given message. If not provided, no attributes are used. A provider to set the attribute on the pubsub message. By default, it's using MetadataAsAttributes which converts all metadata entries as attributes.
func WithOrderingKeyProvider ¶
func WithOrderingKeyProvider(provider OrderingKeyProvider) PublisherOption
WithOrderingKeyProvider is a function that returns an ordering key for a given message. If not provided, no ordering key is used.
type PublisherOptions ¶
type PublisherOptions struct {
// contains filtered or unexported fields
}
type PubsubTopic ¶
type PubsubTopic struct {
// contains filtered or unexported fields
}
func (PubsubTopic) Close ¶
func (p PubsubTopic) Close() error
func (PubsubTopic) GetMessageID ¶
func (p PubsubTopic) GetMessageID(message *pubsub.Message) string
type Subscriber ¶
type Subscriber struct {
// contains filtered or unexported fields
}
func NewGoogleSubscriber ¶
func NewGoogleSubscriber( c *pubsub.Client, subscription string, opts ...SubscriberOption) (*Subscriber, error)
func (*Subscriber) Close ¶
func (s *Subscriber) Close() error
type SubscriberOption ¶
type SubscriberOption func(*SubscriberOptions)
func WithParseAttributes ¶
func WithParseAttributes(parseAttributes bool) SubscriberOption
WithParseAttributes is a flag to indicate if the attributes should be parsed or not, meaning that boolean true/false, integers and floats are going to be their respective types. The default is to just keep everything as strings.
func WithProcessingTimeout ¶
func WithProcessingTimeout(timeout time.Duration) SubscriberOption
WithProcessingTimeout will dictate how long a message will be processed before it is nacked. 0 means no timeout, wait forever. Keep in mind that GCP uses the "Acknowledgement deadline" to determine if a message needs to be redelivered. ProcessingTimeout has no impact on the "Acknowledgement deadline". Default value is 600 seconds, which is the max value of the GCP "Acknowledgement deadline".
func WithProcessingTimeoutHandler ¶
func WithProcessingTimeoutHandler(handler func(ctx context.Context, msg *pubsub.Message)) SubscriberOption
WithProcessingTimeoutHandler is a function that is called when a message processing times out.
func WithReceiveSettings ¶
func WithReceiveSettings(settings pubsub.ReceiveSettings) SubscriberOption
WithReceiveSettings is a set of options to pass the underlying gcp pubsub.Subscription
type SubscriberOptions ¶
type SubscriberOptions struct {
// contains filtered or unexported fields
}