pubsub

package
v0.0.0-...-144358a Latest Latest
Warning

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

Go to latest
Published: Jul 24, 2014 License: MIT Imports: 7 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type Event

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

Event implements pubsub.Event, which is the interface required by the exchange.

func (*Event) Body

func (event *Event) Body() []byte

func (*Event) Kind

func (event *Event) Kind() []byte

func (*Event) Publisher

func (event *Event) Publisher() []byte

func (*Event) Seq

func (event *Event) Seq() []byte

func (*Event) SetSeq

func (event *Event) SetSeq(seq pubsub.EventSeqNum)

type Transport

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

Transport implements client.Transport so it can be used as the underlying transport for a Meeko client instance.

This particular transport is a bit special. It implements inproc transport that uses channels. It is suitable for clients that intend to live in the same process as Meeko.

For using Transport as a service Endpoint for the Meeko broker, check the AsEndpoint method.

func (*Transport) AsEndpoint

func (t *Transport) AsEndpoint() pubsub.Endpoint

AsTransport returns an adapter that makes Transport look like pubsub.Endpoint.

func (*Transport) Close

func (t *Transport) Close() error

func (*Transport) Closed

func (t *Transport) Closed() <-chan struct{}

func (*Transport) ErrorChan

func (t *Transport) ErrorChan() <-chan error

func (*Transport) EventChan

func (t *Transport) EventChan() <-chan pubsub.Event

func (*Transport) EventSeqTableChan

func (t *Transport) EventSeqTableChan() <-chan client.EventSeqTable

func (*Transport) Publish

func (t *Transport) Publish(eventKind string, eventObject interface{}) error

func (*Transport) Subscribe

func (t *Transport) Subscribe(eventKindPrefix string) error

func (*Transport) Unsubscribe

func (t *Transport) Unsubscribe(eventKindPrefix string) error

func (*Transport) Wait

func (t *Transport) Wait() error

type TransportConfig

type TransportConfig struct {
	ChannelCapacity uint
}

TransportConfig serves as a factory for Transport. Once its fields are set to requested values, NewTransport method can be used to construct a Transport for the chosen configuration.

FeedFromEnv can be used to load config from environmental variables.

func NewTransportConfig

func NewTransportConfig() *TransportConfig

NewTransportConfig creates a new TransportConfig with some reasonable defaults.

func (*TransportConfig) FeedFromEnv

func (config *TransportConfig) FeedFromEnv(prefix string) error

FeedFromEnv loads config from the environment.

It checks variables looking like prefix + capitalizedFieldName.

func (*TransportConfig) MustFeedFromEnv

func (config *TransportConfig) MustFeedFromEnv(prefix string) *TransportConfig

func (*TransportConfig) NewTransport

func (config *TransportConfig) NewTransport(identity string, exchange pubsub.Exchange) *Transport

NewTransport creates a new Transport instance for the given configuration.

Jump to

Keyboard shortcuts

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