transports

package
v2.0.4+incompatible Latest Latest
Warning

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

Go to latest
Published: Jun 11, 2016 License: Apache-2.0 Imports: 19 Imported by: 4

Documentation

Index

Constants

This section is empty.

Variables

View Source
var (
	// TransportTCPTCP is the transport name for plain TCP
	TransportTCPTCP = "tcp"
	// TransportTCPTLS is the transport name for encrypted TLS
	TransportTCPTLS = "tls"
)

Functions

func NewTransportTCPFactory

func NewTransportTCPFactory(config *config.Config, configPath string, unUsed map[string]interface{}, name string) (interface{}, error)

NewTransportTCPFactory create a new TransportTCPFactory from the provided configuration data, reporting back any configuration errors it discovers.

Types

type TransportTCP

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

TransportTCP implements a transport that sends over TCP It also can optionally introduce a TLS layer for security

func (*TransportTCP) Fail

func (t *TransportTCP) Fail()

Fail the transport

func (*TransportTCP) Ping

func (t *TransportTCP) Ping() error

Ping the remote server

func (*TransportTCP) ReloadConfig

func (t *TransportTCP) ReloadConfig(factoryInterface interface{}, finishOnFail bool) bool

ReloadConfig returns true if the transport needs to be restarted in order for the new configuration to apply

func (*TransportTCP) Shutdown

func (t *TransportTCP) Shutdown()

Shutdown the transport

func (*TransportTCP) Write

func (t *TransportTCP) Write(nonce string, events []*core.EventDescriptor) error

Write a message to the transport

type TransportTCPFactory

type TransportTCPFactory struct {
	Reconnect      time.Duration `config:"reconnect backoff"`
	ReconnectMax   time.Duration `config:"reconnect backoff max"`
	SSLCertificate string        `config:"ssl certificate"`
	SSLKey         string        `config:"ssl key"`
	SSLCA          string        `config:"ssl ca"`
	// contains filtered or unexported fields
}

TransportTCPFactory holds the configuration from the configuration file It allows creation of TransportTCP instances that use this configuration

func (*TransportTCPFactory) InitDefaults

func (f *TransportTCPFactory) InitDefaults()

InitDefaults sets the default configuration values

func (*TransportTCPFactory) NewTransport

func (f *TransportTCPFactory) NewTransport(observer transports.Observer, finishOnFail bool) transports.Transport

NewTransport returns a new Transport interface using the settings from the TransportTCPFactory.

Jump to

Keyboard shortcuts

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