google

package
v1.0.0-beta.41 Latest Latest
Warning

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

Go to latest
Published: Feb 21, 2025 License: MIT Imports: 2 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type GooglePubSubClient

type GooglePubSubClient struct {
	Client *pubsub.Client
}

func (*GooglePubSubClient) Close

func (g *GooglePubSubClient) Close() error

func (*GooglePubSubClient) CreateSubscription

func (g *GooglePubSubClient) CreateSubscription(ctx context.Context, id string, cfg pubsub.SubscriptionConfig) (Subscription, error)

func (*GooglePubSubClient) Subscription

func (g *GooglePubSubClient) Subscription(id string) Subscription

func (*GooglePubSubClient) Topic

func (g *GooglePubSubClient) Topic(id string) Topic

type GooglePublishResult

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

func (*GooglePublishResult) Get

type GoogleSubscription

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

func (*GoogleSubscription) ID

func (g *GoogleSubscription) ID() string

func (*GoogleSubscription) Receive

func (g *GoogleSubscription) Receive(ctx context.Context, f func(ctx context.Context, msg *pubsub.Message)) error

type GoogleTopic

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

func (*GoogleTopic) GetInstance

func (g *GoogleTopic) GetInstance() *pubsub.Topic

func (*GoogleTopic) Publish

func (g *GoogleTopic) Publish(ctx context.Context, msg *pubsub.Message) PublishResult

type PubSubClient

type PubSubClient interface {
	CreateSubscription(ctx context.Context, id string, cfg pubsub.SubscriptionConfig) (Subscription, error)
	Subscription(id string) Subscription
	Topic(id string) Topic
	Close() error
}

PubSubClient defines the methods required for Pub/Sub client interaction.

type PublishResult

type PublishResult interface {
	Get(ctx context.Context) (string, error)
}

PublishResult abstracts the result of publishing a message.

type Subscription

type Subscription interface {
	ID() string
	Receive(ctx context.Context, f func(ctx context.Context, msg *pubsub.Message)) error
}

Subscription defines the methods required for subscriptions.

type Topic

type Topic interface {
	Publish(ctx context.Context, msg *pubsub.Message) PublishResult
	GetInstance() *pubsub.Topic
}

Topic defines the methods required for publishing messages.

Jump to

Keyboard shortcuts

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