gcppubsub

package
v0.22.3 Latest Latest
Warning

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

Go to latest
Published: Apr 27, 2021 License: MIT Imports: 18 Imported by: 0

Documentation

Index

Constants

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

Variables

This section is empty.

Functions

func NewClient

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

func Read

func Read(opts *cli.Options) error

func Relay added in v0.4.0

func Relay(opts *cli.Options) error

func Write

func Write(opts *cli.Options) 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{}
	// 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