gpubsub

package
v0.1.2 Latest Latest
Warning

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

Go to latest
Published: Jul 28, 2022 License: MIT Imports: 10 Imported by: 0

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

func NewExtractorFactory

func NewExtractorFactory(ctx context.Context, config PubsubConfig) (entity.ExtractorFactory, error)

NewExtractorFactory creates a Pubsub extractory factory.

Types

type DefaultSubConfigurator

type DefaultSubConfigurator struct{}

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 PubsubConfig

type PubsubConfig struct {

	// ProjectId (required) specifies GCP project ID for this deployment.
	ProjectId string

	// Env is only required to be filled in if stream specs for this use of Geist are using different
	// topic specs for different environments, typically "dev", "stage", and "prod".
	// Any string is allowed as long as it matches the ones used in the stream specs.
	Env string

	// The following fields (optional) sets the default values, if not specified in the stream spec.
	// See entity.Spec for more info.
	MaxOutstandingMessages int
	MaxOutstandingBytes    int
}

PubsubConfig is the external config provided by the geist client to the factory when starting up, which is to be used during stream creations

TODO: Check if non-nil default values should be added to MaxOutstandingXxx

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