pubsub

package
v0.0.0-...-3705e9c Latest Latest
Warning

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

Go to latest
Published: Jan 23, 2016 License: Apache-2.0 Imports: 12 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type Broker

type Broker struct {
	ProjectID string
	JSONKey   string
}

Broker implements the broker interface for Google Cloud Pub/Sub.

func (*Broker) Start

func (c *Broker) Start(host, port string) (interface{}, error)

Start will start the message broker and prepare it for testing.

func (*Broker) Stop

func (c *Broker) Stop() (interface{}, error)

Stop will stop the message broker.

type Peer

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

Peer implements the peer interface for Google Cloud Pub/Sub.

func NewPeer

func NewPeer(projectID, jsonKey string) (*Peer, error)

NewPeer creates and returns a new Peer for communicating with Google Cloud Pub/Sub.

func (*Peer) Done

func (c *Peer) Done()

Done signals to the peer that message publishing has completed.

func (*Peer) Errors

func (c *Peer) Errors() <-chan error

Errors returns the channel on which the peer sends publish errors.

func (*Peer) Recv

func (c *Peer) Recv() ([]byte, error)

Recv returns a single message consumed by the peer. Subscribe must be called before this. It returns an error if the receive failed.

func (*Peer) Send

func (c *Peer) Send() chan<- []byte

Send returns a channel on which messages can be sent for publishing.

func (*Peer) Setup

func (c *Peer) Setup()

Setup prepares the peer for testing.

func (*Peer) Subscribe

func (c *Peer) Subscribe() error

Subscribe prepares the peer to consume messages.

func (*Peer) Teardown

func (c *Peer) Teardown()

Teardown performs any cleanup logic that needs to be performed after the test is complete.

Jump to

Keyboard shortcuts

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