transports

package
v2.0.3+incompatible Latest Latest
Warning

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

Go to latest
Published: May 9, 2016 License: Apache-2.0 Imports: 4 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

View Source
var ErrForcedFailure = errors.New("Failed by endpoint manager")

ErrForcedFailure is an error a Transport can use to represent a forced failure by the publisher

Functions

This section is empty.

Types

type AckEvent

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

AckEvent contains information on which events have been acknowledged

func NewAckEvent

func NewAckEvent(observer Observer, nonce string, sequence uint32) *AckEvent

NewAckEvent generates a new AckEvent for the given Endpoint

func NewAckEventWithBytes

func NewAckEventWithBytes(observer Observer, nonce []byte, sequence []byte) *AckEvent

NewAckEventWithBytes generates a new AckEvent using bytes, conveniently converting them to string and uint32

func (*AckEvent) Nonce

func (e *AckEvent) Nonce() string

Nonce returns the nonce value

func (*AckEvent) Observer

func (e *AckEvent) Observer() Observer

Observer returns the endpoint associated with this event

func (*AckEvent) Sequence

func (e *AckEvent) Sequence() uint32

Sequence returns the sequence value

type Event

type Event interface {
	Observer() Observer
}

Event is the interface implemented by all event structures

type Observer

type Observer interface {
	Pool() *addresspool.Pool
	EventChan() chan<- Event
}

Observer is the interface implemented by the consumer of a transport, to allow the transport to communicate back To all intents and purposes this is the Endpoint

type PongEvent

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

PongEvent is received when a transport has responded to a Ping() request

func NewPongEvent

func NewPongEvent(observer Observer) *PongEvent

NewPongEvent generates a new PongEvent for the given Endpoint

func (*PongEvent) Observer

func (e *PongEvent) Observer() Observer

Observer returns the endpoint associated with this event

type StatusChange

type StatusChange int

StatusChange holds a value that represents a change in transport status

const (
	Started StatusChange = iota
	Failed
	Finished
)

Transport status change signals

type StatusEvent

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

StatusEvent contains information about a status change for a transport

func NewStatusEvent

func NewStatusEvent(observer Observer, statusChange StatusChange) *StatusEvent

NewStatusEvent generates a new StatusEvent for the given Observer/Endpoint

func (*StatusEvent) Observer

func (e *StatusEvent) Observer() Observer

Observer returns the endpoint associated with this event

func (*StatusEvent) StatusChange

func (e *StatusEvent) StatusChange() StatusChange

StatusChange returns the status change value

type Transport

type Transport interface {
	Fail()
	Ping() error
	ReloadConfig(interface{}, bool) bool
	Shutdown()
	Write(string, []*core.EventDescriptor) error
}

Transport is the generic interface that all transports implement

func NewTransport

func NewTransport(factory interface{}, observer Observer, finishOnFail bool) Transport

NewTransport returns a Transport interface initialised from the given Factory

Directories

Path Synopsis

Jump to

Keyboard shortcuts

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