ifaces_pubsub

package
v0.18.0-rc.7 Latest Latest
Warning

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

Go to latest
Published: Sep 5, 2022 License: Apache-2.0 Imports: 5 Imported by: 0

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