clients

package
v0.0.0-...-0299d3b Latest Latest
Warning

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

Go to latest
Published: Mar 27, 2024 License: Apache-2.0 Imports: 11 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type Publisher

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

A Publisher represents a publisher struct with a GCP Pub/Sub client.

func NewPublisher

func NewPublisher(ctx context.Context, cfg config.Destination) (*Publisher, error)

NewPublisher initializes a new publisher client.

func (*Publisher) Publish

func (p *Publisher) Publish(ctx context.Context, record sdk.Record) error

Publish publishes records to the GCP Pub/Sub topic.

func (*Publisher) Stop

func (p *Publisher) Stop() error

Stop sends all remaining published messages and stop goroutines created for handling publishing, and releases any resources held by the client, such as memory and goroutines.

type PublisherLite

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

A PublisherLite represents a publisher struct with a GCP Pub/Sub Lite client.

func NewPublisherLite

func NewPublisherLite(ctx context.Context, cfg config.Destination) (*PublisherLite, error)

NewPublisherLite initializes a new publisher client of GCP Pub/Sub Lite.

func (*PublisherLite) Publish

func (pl *PublisherLite) Publish(ctx context.Context, record sdk.Record) error

Publish publishes a record to the GCP Pub/Sub Lite topic.

func (*PublisherLite) Stop

func (pl *PublisherLite) Stop() error

Stop sends all remaining published messages and closes publish streams.

type Subscriber

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

Subscriber represents a struct with a GCP Pub/Sub client, queues for messages, an error channel.

func NewSubscriber

func NewSubscriber(ctx context.Context, cfg config.Source) (*Subscriber, error)

NewSubscriber initializes a new subscriber client of GCP Pub/Sub and starts receiving a messages to the message queue.

func (Subscriber) Ack

func (s Subscriber) Ack(ctx context.Context) error

Ack indicates successful processing of a Message passed.

func (Subscriber) Next

func (s Subscriber) Next(ctx context.Context) (sdk.Record, error)

Next returns the next record or an error.

func (*Subscriber) Stop

func (s *Subscriber) Stop() error

Stop calls stop method and releases the GCP Pub/Sub client.

type SubscriberLite

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

SubscriberLite represents queues for messages, an error channel.

func NewSubscriberLite

func NewSubscriberLite(ctx context.Context, cfg config.Source) (*SubscriberLite, error)

NewSubscriberLite initializes a new subscriber client of GCP Pub/Sub Lite and starts receiving a messages to the message queue.

func (SubscriberLite) Ack

func (s SubscriberLite) Ack(ctx context.Context) error

Ack indicates successful processing of a Message passed.

func (SubscriberLite) Next

func (s SubscriberLite) Next(ctx context.Context) (sdk.Record, error)

Next returns the next record or an error.

func (*SubscriberLite) Stop

func (sl *SubscriberLite) Stop() error

Stop calls stop method.

Jump to

Keyboard shortcuts

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