ifaces_pubsub

package
v0.14.1 Latest Latest
Warning

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

Go to latest
Published: Mar 3, 2022 License: Apache-2.0 Imports: 5 Imported by: ? modules, 0 packages

The first number is the count of modules that contain a package that imports this one. The module count is a better indicator of popularity than the package count. A module with 100 importing packages is counted only once instead of 100 times, reflecting the fact that the choice to use the package was likely made only once, not 100 times.
A '?' means that the value hasn't been computed yet.

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type Message

type Message interface {
	ID() string
	Data() []byte
	Attributes() map[string]string
	PublishTime() time.Time
	Ack()
	Nack()
}

func AdaptPubsubMessage

func AdaptPubsubMessage(msg *pubsub.Message) Message

AdaptMessage adapts a pubsub.Message so that it satisfies the Message interface.

type PublishResult

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

type PubsubClient

type PubsubClient interface {
	// CreateTopic(ctx context.Context, topicID string) (Topic, error)
	Topic(id string) Topic
	Topics(ctx context.Context) TopicIterator
}

func AdaptPubsubClient

func AdaptPubsubClient(c *pubsub.Client) PubsubClient

AdaptClient adapts a pubsub.Client so that it satisfies the Client interface.

type SubscriberClient

type SubscriberClient interface {
	Close() error
	Pull(ctx context.Context, req *pubsubpb.PullRequest, opts ...gax.CallOption) (*pubsubpb.PullResponse, error)
	Acknowledge(ctx context.Context, req *pubsubpb.AcknowledgeRequest, opts ...gax.CallOption) error
}

type Subscription

type Subscription interface {
	ID() string
	String() string
}

type SubscriptionIterator

type SubscriptionIterator interface {
	Next() (Subscription, error)
}

type Topic

type Topic interface {
	String() string
	Publish(ctx context.Context, msg Message) PublishResult
	Exists(ctx context.Context) (bool, error)
	Subscriptions(ctx context.Context) SubscriptionIterator
	ID() string
}

type TopicIterator

type TopicIterator interface {
	Next() (Topic, error)
}

Jump to

Keyboard shortcuts

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