pubsub

package
v0.1.111 Latest Latest
Warning

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

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

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type Blackbox

type Blackbox interface {
	contract.Base64Decoder
}

type Client

type Client interface {
	Blackbox
	contract.PubSubOperator
}

func NewClient

func NewClient(d Dependencies) (Client, error)

type DefaultTool added in v0.1.11

type DefaultTool struct {
	T *contract.Tool[Client]
}

func NewTool

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

func (*DefaultTool) DecodePayload added in v0.1.11

func (d *DefaultTool) DecodePayload(ctx context.Context, r *http.Request) (contract.PubSubMessage, error)

DecodePayload extracts and decodes a Pub/Sub message from an HTTP request.

func (*DefaultTool) MockPubSubPayload added in v0.1.11

func (d *DefaultTool) MockPubSubPayload(ctx context.Context, msg contract.PubSubMessage, subscription string) (io.Reader, error)

MockPubSubPayload creates a mock Pub/Sub payload for testing purposes.

type Dependencies added in v0.1.8

type Dependencies struct {
	M contract.Marshaler
	U contract.Unmarshaler
}

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