xpubsub

package
v0.2.0 Latest Latest
Warning

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

Go to latest
Published: May 1, 2022 License: MIT Imports: 10 Imported by: 0 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

View Source
const (
	SubTypeShared = "shared"
	SubTypeUnique = "unique"

	ALREADY_EXISTS = 409 // Defined here due to lack of proper other place in GCP libs
)

Variables

This section is empty.

Functions

This section is empty.

Types

type DefaultSubConfigurator

type DefaultSubConfigurator struct{}

type Extractor

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

func NewExtractor

func NewExtractor(ctx context.Context, config *ExtractorConfig, id string) (*Extractor, error)

The pubsub Extractor expects the pubsub topic to extract from, to already exist

func (*Extractor) Extract

func (e *Extractor) Extract(ctx context.Context, query model.ExtractorQuery, result any) (error, bool)

func (*Extractor) ExtractFromSink

func (e *Extractor) ExtractFromSink(ctx context.Context, query model.ExtractorQuery, result *[]*model.Transformed) (error, bool)

func (*Extractor) SendToSource

func (e *Extractor) SendToSource(ctx context.Context, eventData any) (string, error)

func (*Extractor) SetMsgAckNackFunc

func (g *Extractor) SetMsgAckNackFunc(ack MsgAckFunc, nack MsgAckFunc)

func (*Extractor) SetSub

func (g *Extractor) SetSub(sub Subscription)

func (*Extractor) SetTopic

func (g *Extractor) SetTopic(topic Topic)

func (*Extractor) StreamExtract

func (e *Extractor) StreamExtract(
	ctx context.Context,
	reportEvent model.ProcessEventFunc,
	err *error,
	retryable *bool)

type ExtractorConfig

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

func NewExtractorConfig

func NewExtractorConfig(
	client PubsubClient,
	spec *model.Spec,
	topics []string,
	rs ReceiveSettings) *ExtractorConfig

type MsgAckFunc

type MsgAckFunc func(*pubsub.Message)

type PubsubClient

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

type ReceiveSettings

type ReceiveSettings struct {
	MaxOutstandingMessages int
	MaxOutstandingBytes    int
	Synchronous            bool
	NumGoroutines          int
}

type SubConfigurator

type SubConfigurator interface {
	Update(sub Subscription, rs pubsub.ReceiveSettings)
}

type Subscription

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

type Topic

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

Jump to

Keyboard shortcuts

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