Documentation ¶
Index ¶
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
func MakeDialerJobs ¶
func MakeDialerJobs( b *Builder, typ, scheme string, endpoints []Endpoint, mode monitors.IPSettings, fn func(dialer transport.Dialer, addr string) (common.MapStr, error), ) ([]monitors.Job, error)
MakeDialerJobs creates a set of monitoring jobs. The jobs behavior depends on the builder, endpoint and mode configurations, normally set by user configuration. The task to execute the actual 'ping' receives the dialer and the address pair (<hostname>:<port>), required to be used, to ping the correctly resolved endpoint.
Types ¶
type Builder ¶
type Builder struct {
// contains filtered or unexported fields
}
Builder maintains a DialerChain for building dialers and dialer based monitoring jobs. The builder ensures a constant address is being used, for any host configured. This ensures the upper network layers (e.g. TLS) correctly see and process the original hostname.
func NewBuilder ¶
func NewBuilder(settings BuilderSettings) (*Builder, error)
NewBuilder creates a new Builder for constructing dialers.
type BuilderSettings ¶
type BuilderSettings struct { Timeout time.Duration Socks5 transport.ProxyConfig TLS *transport.TLSConfig }
BuilderSettings configures the layers of the dialer chain to be constructed by a Builder.
type DialerChain ¶
DialerChain composes builders for multiple network layers, used to build the final transport.Dialer object based on the network layers. Each layer can hold individual configurations. Use 'Clone' to copy and replace/wrap layers at will. Once all Layers have been prepared, use Build to build a transport.Dialer that can used with any go library network packages relying on standard library based dialers.
For Additional Layering capabilities, DialerChain implements the NetDialer interface.
func (*DialerChain) AddLayer ¶
func (c *DialerChain) AddLayer(l Layer)
AddLayer adds another layer to the dialer chain. The layer being added is the new topmost network layer using the other already present layers on dial.
func (*DialerChain) Build ¶
Build create a new transport.Dialer for use with other networking libraries.
func (*DialerChain) Clone ¶
func (c *DialerChain) Clone() *DialerChain
Clone create a shallow copy of c.
func (*DialerChain) TestBuild ¶
func (c *DialerChain) TestBuild() error
TestBuild tries to build the DialerChain and reports any error reported by one of the layers.
type Endpoint ¶
Endpoint configures a host with all port numbers to be monitored by a dialer based job.
type Layer ¶
Layer is a configured network layer, wrapping any lower-level network layers.
func ConstAddrLayer ¶
ConstAddrLayer introduces a network layer always passing a constant address to the underlying layer.
func MakeConstAddrLayer ¶
MakeConstAddrLayer always passes the same address to the original Layer. This is useful if a lookup did return multiple IPs for the same hostname, but the IP use to connect shall be fixed.
func SOCKS5Layer ¶
func SOCKS5Layer(config *transport.ProxyConfig) Layer
SOCKS5Layer configures a SOCKS5 proxy layer in a DialerChain.
The layer will update the active event with:
{ "socks5": { "rtt": { "connect": { "us": ... }} } }
type NetDialer ¶
NetDialer provides the most low-level network layer for setting up a network connection. NetDialer objects do not support wrapping any lower network layers.
func MakeConstAddrDialer ¶
MakeConstAddrDialer always passes the same address to the original NetDialer. This is useful if a lookup did return multiple IPs for the same hostname, but the IP use to connect shall be fixed.
func TCPDialer ¶
TCPDialer creates a new NetDialer with constant event fields and default connection timeout. The fields parameter holds additional constants to be added to the final event structure.
The dialer will update the active events with:
{ "tcp": { "port": ..., "rtt": { "connect": { "us": ... }} } }
func UDPDialer ¶
UDPDialer creates a new NetDialer with constant event fields and default connection timeout. The fields parameter holds additional constants to be added to the final event structure.
The dialer will update the active events with:
{ "udp": { "port": ..., "rtt": { "connect": { "us": ... }} } }