gcppubsub

package
v0.35.1 Latest Latest
Warning

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

Go to latest
Published: Nov 15, 2021 License: MIT Imports: 18 Imported by: 0

Documentation

Index

Constants

View Source
const (
	RetryReadInterval = 5 * time.Second
)

Variables

View Source
var (
	ErrMissingOptions     = errors.New("options cannot be nil")
	ErrMissingGCPOptions  = errors.New("GCP PubSub options cannot be nil")
	ErrMissingCredentials = errors.New("Either --credentials-file or --credentials-json must be specified")
)

Functions

func Dynamic added in v0.28.0

func Dynamic(opts *cli.Options) error

Dynamic starts up a new GRPC client connected to the dProxy service and receives a stream of outbound replay messages which are then written to the message bus.

func NewClient

func NewClient(opts *cli.Options) (*pubsub.Client, error)

func Read

func Read(opts *cli.Options, md *desc.MessageDescriptor) error

func Relay added in v0.4.0

func Relay(opts *cli.Options, relayCh chan interface{}, shutdownCtx context.Context) (relay.IRelayBackend, error)

func Write

func Write(opts *cli.Options, md *desc.MessageDescriptor) error

Write is the entry point function for performing write operations in GCP PubSub.

This is where we verify that the passed args and flags combo makes sense, attempt to establish a connection, parse protobuf before finally attempting to perform the write.

Types

type GCPPubSub

type GCPPubSub struct {
	Options *cli.Options
	MsgDesc *desc.MessageDescriptor
	Client  *pubsub.Client
	// contains filtered or unexported fields
}

func (*GCPPubSub) Read

func (g *GCPPubSub) Read() error

func (*GCPPubSub) Write

func (g *GCPPubSub) Write(ctx context.Context, value []byte) error

Write is a wrapper for amqp Publish method. We wrap it so that we can mock it in tests, add logging etc.

type Relayer added in v0.14.0

type Relayer struct {
	Client      *pubsub.Client
	Options     *cli.Options
	RelayCh     chan interface{}
	ShutdownCtx context.Context
	// contains filtered or unexported fields
}

func (*Relayer) Relay added in v0.14.0

func (r *Relayer) Relay() error

Directories

Path Synopsis

Jump to

Keyboard shortcuts

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