pubsub

package
v0.0.4 Latest Latest
Warning

This package is not in the latest version of its module.

Go to latest
Published: Mar 17, 2025 License: MIT Imports: 9 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

View Source
var ErrEmptyRequestBody = errors.New("empty body")
View Source
var ErrInvalidContentType = errors.New("invalid content type")

Functions

func NewTool

func NewTool(c Client, opts contract.ToolOptions[Client]) *defaultTool

Types

type Client

type Client interface {
	DecodePubSubMessage(r *http.Request, message *pubsub.Message) error
}

func NewClient

func NewClient(U contract.Unmarshaler) (Client, error)

type PubSubPayload

type PubSubPayload struct {
	Message struct {
		Data        []byte            `json:"data,omitempty"`
		Attributes  map[string]string `json:"attributes,omitempty"`
		MessageID   string            `json:"messageId,omitempty"`
		PublishTime time.Time         `json:"publishTime,omitempty"`
	} `json:"message,omitempty"`
	Subscription string `json:"subscription,omitempty"`
}

Jump to

Keyboard shortcuts

? : This menu
/ : Search site
f or F : Jump to
y or Y : Canonical URL