Documentation ¶
Index ¶
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
This section is empty.
Types ¶
type Cluster ¶
Cluster represents a set of host with some kind of routing (sharding) defined by it's type.
type ClusterTarget ¶
type ClusterTarget interface { PushBytes(*rec.RecBytes, *metrics.Prom) error Send(*sync.WaitGroup, chan struct{}) GetName() string }
ClusterTarget is abstract notion of a target to send the records to during processing.
type Clusters ¶
Clusters are all clusters mapped by name.
type Connection ¶
Connection contains all the attributes of the target host connection.
func (*Connection) Close ¶
func (c *Connection) Close() error
Close the connection while mainaining correct internal state. Overrides c.Conn.Close(). Use instead the default close.
type Host ¶
type Host struct { Name string Port uint16 Ch chan *rec.RecBytes Available atomic.Bool Conn Connection Lg *zap.Logger Ms *metrics.Prom // contains filtered or unexported fields }
Host represents a single target hosts to send records to.
func ConstructHost ¶
func ConstructHost(clusterName string, mainCfg conf.Main, hostCfg conf.Host, lg *zap.Logger, ms *metrics.Prom) *Host
ConstructHost builds new host object from config.
func (*Host) IsAvailable ¶
IsAvailable tells if the host is alive.
type HostGRPC ¶
type HostGRPC struct {
Host
}
HostGRPC represents a single target hosts to send records to.
type HostTCP ¶
type HostTCP struct {
Host
}
HostTCP will represent TCP host. It's a stub for now, its role is currently carried out by the Host struct.
type Target ¶
type Target interface { Stream(wg *sync.WaitGroup) Push(r *rec.RecBytes) IsAvailable() bool Stop() }
Target represents target the records are sent to
type TestTarget ¶
TestTarget mocks a target cluster in tests.
func (*TestTarget) PushBytes ¶
PushBytes is a push in tests. It does nothing, just increases the counter.
func (*TestTarget) Send ¶
func (tt *TestTarget) Send(wg *sync.WaitGroup, finish chan struct{})
Send emulates mocks a remote sending routine. Does nothing.