Documentation ¶
Index ¶
- Constants
- func RegisterForwarder(name string, f func(int, *l.Entry) Forwarder)
- type BaseForwarder
- func (base *BaseForwarder) InitListeners(globalConfig config.Config)
- func (base BaseForwarder) InternalMetrics() InternalMetrics
- func (base BaseForwarder) KeepAliveInterval() int
- func (base BaseForwarder) ListenerChannels() map[string]chan []byte
- func (base BaseForwarder) MaxBufferSize() int
- func (base BaseForwarder) Name() string
- func (base *BaseForwarder) SetKeepAliveInterval(value int)
- func (base *BaseForwarder) SetListenerChannels(c map[string]chan []byte)
- func (base *BaseForwarder) SetMaxBufferSize(size int)
- func (base BaseForwarder) String() string
- type Forwarder
- type InternalMetrics
- type Kafka
- type TCP
- type UDP
Constants ¶
const ( DefaultBufferSize = 100 DefaultKeepAliveInterval = 30 )
Some sane values to default things to
Variables ¶
This section is empty.
Functions ¶
Types ¶
type BaseForwarder ¶
type BaseForwarder struct {
// contains filtered or unexported fields
}
BaseForwarder is class to handle the boiler plate parts of the forwarders
func (*BaseForwarder) InitListeners ¶
func (base *BaseForwarder) InitListeners(globalConfig config.Config)
InitListeners - initiate channels for listeners
func (BaseForwarder) InternalMetrics ¶
func (base BaseForwarder) InternalMetrics() InternalMetrics
InternalMetrics : Returns the internal metrics that are being collected by this forwarder
func (BaseForwarder) KeepAliveInterval ¶
func (base BaseForwarder) KeepAliveInterval() int
KeepAliveInterval - return keep alive interval
func (BaseForwarder) ListenerChannels ¶
func (base BaseForwarder) ListenerChannels() map[string]chan []byte
ListenerChannels : the channels to forwarders listens for messages on
func (BaseForwarder) MaxBufferSize ¶
func (base BaseForwarder) MaxBufferSize() int
MaxBufferSize : the maximum number of messages to be in the circular buffer
func (BaseForwarder) Name ¶
func (base BaseForwarder) Name() string
Name : the name of the forwarder
func (*BaseForwarder) SetKeepAliveInterval ¶
func (base *BaseForwarder) SetKeepAliveInterval(value int)
SetKeepAliveInterval : Set keep alive interval
func (*BaseForwarder) SetListenerChannels ¶
func (base *BaseForwarder) SetListenerChannels(c map[string]chan []byte)
SetListenerChannels : the channels to forwarder listens for messages on
func (*BaseForwarder) SetMaxBufferSize ¶
func (base *BaseForwarder) SetMaxBufferSize(size int)
SetMaxBufferSize : set the buffer size
func (BaseForwarder) String ¶
func (base BaseForwarder) String() string
String returns the forwarder name in a printable format.
type Forwarder ¶
type Forwarder interface { Run() Configure(map[string]interface{}) InitListeners(config.Config) // InternalMetrics is to publish a set of values // that are relevant to the forwarder itself. InternalMetrics() InternalMetrics // taken care of by the base Name() string String() string ListenerChannels() map[string]chan []byte SetListenerChannels(map[string]chan []byte) MaxBufferSize() int SetMaxBufferSize(int) KeepAliveInterval() int SetKeepAliveInterval(int) }
Forwarder defines the interface of a generic forwarder.
type InternalMetrics ¶
InternalMetrics holds the key:value pairs for counters/gauges
func NewInternalMetrics ¶
func NewInternalMetrics() *InternalMetrics
NewInternalMetrics initializes the internal components of InternalMetrics
type Kafka ¶
type Kafka struct { BaseForwarder // contains filtered or unexported fields }
Kafka forwarder
type TCP ¶
type TCP struct { BaseForwarder // contains filtered or unexported fields }
TCP forwarder