publisher

package
v0.0.0-...-b56df8a Latest Latest
Warning

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

Go to latest
Published: Jul 24, 2017 License: MIT Imports: 6 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

View Source
var MockMessageReceiver map[string]chan []byte

MockMessageReceiver is a channel that can take []byte messages that will be sent from the mock publisher

Functions

func TurnMockModOff

func TurnMockModOff()

TurnMockModOff will disable the consumer New method to return with Mock struct instead of the real one. This is only for testing purpose!

func TurnMockModOn

func TurnMockModOn()

TurnMockModOn will enable the consumer New method to return with Mock struct instead of the real one. This is only for testing purpose!

Types

type Options

type Options interface {
	Configure(config *config)
}

Options is the public interface when working with options

type Publisher

type Publisher interface {
	Publish(...[]byte) ([]string, error)
}

Publisher is the public interface when you work with the publisher package This is used to force the developer writing code that can be tested easily

func New

func New(ctx context.Context, topicName string, opts ...Options) Publisher

New will return a new publisher object that can publish []byte messages to a given google cloud pubsub topic

Jump to

Keyboard shortcuts

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