pubsub

package
v0.0.6 Latest Latest
Warning

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

Go to latest
Published: Mar 26, 2025 License: Apache-2.0 Imports: 11 Imported by: 2

Documentation

Index

Constants

This section is empty.

Variables

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

Functions

func NewTool

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

Types

type Blackbox

type Blackbox interface {
	contract.Base64Decoder
}

type Client

type Client interface {
	Blackbox
	MockPubSubPayload(msg contract.PubSubMessage, subscription string) (io.Reader, error)
	DecodePayload(r *http.Request) (contract.PubSubMessage, error)
}

type Payload

type Payload struct {
	Message      pubsub.Message `json:"message,omitempty"`
	Subscription string         `json:"subscription,omitempty"`
}

type PubSubMessageWrapper

type PubSubMessageWrapper struct {
	Msg *pubsub.Message
}

func (*PubSubMessageWrapper) GetAttributes

func (p *PubSubMessageWrapper) GetAttributes() map[string]string

func (*PubSubMessageWrapper) GetData

func (p *PubSubMessageWrapper) GetData() []byte

func (*PubSubMessageWrapper) GetMessageID

func (p *PubSubMessageWrapper) GetMessageID() string

func (*PubSubMessageWrapper) GetPublishTime

func (p *PubSubMessageWrapper) GetPublishTime() time.Time

Jump to

Keyboard shortcuts

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