topic

package
v0.0.0-...-cadae65 Latest Latest
Warning

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

Go to latest
Published: Sep 10, 2024 License: CC0-1.0 Imports: 6 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func ExtractOtel

func ExtractOtel(ctx context.Context, message *pubsub.Message) context.Context

func InjectOtel

func InjectOtel(ctx context.Context, message *pubsub.Message)

Types

type GoogleTopic

type GoogleTopic struct {
	// contains filtered or unexported fields
}

GoogleTopic is a wrapper for Google Cloud Pub/Sub Topic.

func NewGoogleTopic

func NewGoogleTopic(ctx context.Context, projectID, topicID string) (*GoogleTopic, error)

func (*GoogleTopic) Close

func (t *GoogleTopic) Close(ctx context.Context) error

func (*GoogleTopic) Publish

func (t *GoogleTopic) Publish(ctx context.Context, message Message) error

type Message

type Message struct {
	Data        []byte
	Attributes  map[string]string
	OrderingKey string
}

type SpyTopic

type SpyTopic struct {
	// contains filtered or unexported fields
}

func NewSpyTopic

func NewSpyTopic() *SpyTopic

func (*SpyTopic) Publish

func (t *SpyTopic) Publish(ctx context.Context, message Message) error

func (*SpyTopic) ReceivedData

func (t *SpyTopic) ReceivedData() []Message

ReceivedData is a test helper to get the list of message data sent by SUT.

type Topic

type Topic interface {
	Publish(ctx context.Context, message Message) error
}

Jump to

Keyboard shortcuts

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