network

package
v0.0.0-...-2081a44 Latest Latest
Warning

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

Go to latest
Published: Jun 10, 2018 License: Apache-2.0 Imports: 44 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

View Source
var ServerDefinitelyStopped = eerrors.WithTypes(eerrors.New("Server is definitely stopped"), "Stopped")
View Source
var ServerNotStopped = eerrors.WithTypes(eerrors.New("Server is not stopped"), "Stopped")

Functions

func NewDirectRelpService

func NewDirectRelpService(env *base.ProviderEnv) (base.Provider, error)

func NewGraylogService

func NewGraylogService(env *base.ProviderEnv) (base.Provider, error)

func NewHTTPService

func NewHTTPService(env *base.ProviderEnv) (base.Provider, error)

func NewKafkaService

func NewKafkaService(env *base.ProviderEnv) (base.Provider, error)

func NewRelpService

func NewRelpService(env *base.ProviderEnv) (base.Provider, error)

func TcpSplit

func TcpSplit(data []byte, atEOF bool) (advance int, token []byte, eoferr error)

Types

type DirectRelpHandler

type DirectRelpHandler struct {
	Server *DirectRelpServiceImpl
}

func (DirectRelpHandler) HandleConnection

func (h DirectRelpHandler) HandleConnection(conn net.Conn, c conf.TCPSourceConfig) (rerr error)

type DirectRelpService

type DirectRelpService struct {
	QueueSize uint64
	// contains filtered or unexported fields
}

func (*DirectRelpService) FatalError

func (s *DirectRelpService) FatalError() chan struct{}

func (*DirectRelpService) Gather

func (s *DirectRelpService) Gather() ([]*dto.MetricFamily, error)

func (*DirectRelpService) SetConf

func (s *DirectRelpService) SetConf(c conf.BaseConfig)

func (*DirectRelpService) Shutdown

func (s *DirectRelpService) Shutdown()

func (*DirectRelpService) Start

func (s *DirectRelpService) Start() (infos []model.ListenerInfo, err error)

func (*DirectRelpService) Stop

func (s *DirectRelpService) Stop()

func (*DirectRelpService) Type

func (s *DirectRelpService) Type() base.Types

type DirectRelpServiceImpl

type DirectRelpServiceImpl struct {
	StreamingService
	RelpConfigs []conf.DirectRELPSourceConfig

	StatusChan chan RelpServerStatus
	// contains filtered or unexported fields
}

func NewDirectRelpServiceImpl

func NewDirectRelpServiceImpl(confined bool, reporter *base.Reporter, b binder.Client, logger log15.Logger) *DirectRelpServiceImpl

func (*DirectRelpServiceImpl) EndWait

func (s *DirectRelpServiceImpl) EndWait()

func (*DirectRelpServiceImpl) FinalStop

func (s *DirectRelpServiceImpl) FinalStop()

func (*DirectRelpServiceImpl) SetConf

func (*DirectRelpServiceImpl) Start

func (*DirectRelpServiceImpl) Stop

func (s *DirectRelpServiceImpl) Stop()

func (*DirectRelpServiceImpl) StopAndWait

func (s *DirectRelpServiceImpl) StopAndWait()

type GraylogStatus

type GraylogStatus int
const (
	GraylogStopped GraylogStatus = iota
	GraylogStarted
)

type GraylogSvcImpl

type GraylogSvcImpl struct {
	base.BaseService
	Configs []conf.GraylogSourceConfig
	// contains filtered or unexported fields
}

func (*GraylogSvcImpl) FatalError

func (s *GraylogSvcImpl) FatalError() chan struct{}

func (*GraylogSvcImpl) Gather

func (s *GraylogSvcImpl) Gather() ([]*dto.MetricFamily, error)

func (*GraylogSvcImpl) ListenPacket

func (s *GraylogSvcImpl) ListenPacket() []model.ListenerInfo

func (*GraylogSvcImpl) SetConf

func (s *GraylogSvcImpl) SetConf(c conf.BaseConfig)

func (*GraylogSvcImpl) Shutdown

func (s *GraylogSvcImpl) Shutdown()

func (*GraylogSvcImpl) Start

func (s *GraylogSvcImpl) Start() (infos []model.ListenerInfo, err error)

func (*GraylogSvcImpl) Stop

func (s *GraylogSvcImpl) Stop()

func (*GraylogSvcImpl) Type

func (s *GraylogSvcImpl) Type() base.Types

type HTTPServiceImpl

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

func (*HTTPServiceImpl) FatalError

func (s *HTTPServiceImpl) FatalError() chan struct{}

func (*HTTPServiceImpl) Gather

func (s *HTTPServiceImpl) Gather() ([]*dto.MetricFamily, error)

func (*HTTPServiceImpl) SetConf

func (s *HTTPServiceImpl) SetConf(c conf.BaseConfig)

func (*HTTPServiceImpl) Shutdown

func (s *HTTPServiceImpl) Shutdown()

func (*HTTPServiceImpl) Start

func (s *HTTPServiceImpl) Start() (infos []model.ListenerInfo, err error)

func (*HTTPServiceImpl) Stop

func (s *HTTPServiceImpl) Stop()

func (*HTTPServiceImpl) Type

func (s *HTTPServiceImpl) Type() base.Types

func (*HTTPServiceImpl) Write

func (s *HTTPServiceImpl) Write(p []byte) (int, error)

type KafkaServiceImpl

type KafkaServiceImpl struct {
	MaxMessageSize int
	// contains filtered or unexported fields
}

func (*KafkaServiceImpl) FatalError

func (s *KafkaServiceImpl) FatalError() chan struct{}

func (*KafkaServiceImpl) Gather

func (s *KafkaServiceImpl) Gather() ([]*dto.MetricFamily, error)

func (*KafkaServiceImpl) SetConf

func (s *KafkaServiceImpl) SetConf(c conf.BaseConfig)

func (*KafkaServiceImpl) Shutdown

func (s *KafkaServiceImpl) Shutdown()

func (*KafkaServiceImpl) Start

func (s *KafkaServiceImpl) Start() (infos []model.ListenerInfo, err error)

func (*KafkaServiceImpl) Stop

func (s *KafkaServiceImpl) Stop()

func (*KafkaServiceImpl) Type

func (s *KafkaServiceImpl) Type() base.Types

type RelpHandler

type RelpHandler struct {
	Server *RelpService
}

func (RelpHandler) HandleConnection

func (h RelpHandler) HandleConnection(conn net.Conn, c conf.TCPSourceConfig) (err error)

type RelpServerStatus

type RelpServerStatus int
const (
	Stopped RelpServerStatus = iota
	Started
	FinalStopped
	Waiting
)

type RelpService

type RelpService struct {
	StreamingService

	ACKQueueSize uint64
	// contains filtered or unexported fields
}

func (*RelpService) FatalError

func (s *RelpService) FatalError() chan struct{}

func (*RelpService) Gather

func (s *RelpService) Gather() ([]*dto.MetricFamily, error)

func (*RelpService) Parse

func (s *RelpService) Parse() error

func (*RelpService) SetConf

func (s *RelpService) SetConf(c conf.BaseConfig)

func (*RelpService) Shutdown

func (s *RelpService) Shutdown()

func (*RelpService) Start

func (s *RelpService) Start() ([]model.ListenerInfo, error)

func (*RelpService) Stop

func (s *RelpService) Stop()

func (*RelpService) Type

func (s *RelpService) Type() base.Types

type StreamHandler

type StreamHandler interface {
	HandleConnection(conn net.Conn, config conf.TCPSourceConfig) error
}

type StreamingService

type StreamingService struct {
	base.BaseService
	SourceConfigs []conf.TCPSourceConfig
	TCPListeners  []TCPListenerConf
	UnixListeners []UnixListenerConf

	MaxMessageSize int
	// contains filtered or unexported fields
}

func (*StreamingService) AcceptTCP

func (s *StreamingService) AcceptTCP(lc TCPListenerConf) error

func (*StreamingService) AcceptUnix

func (s *StreamingService) AcceptUnix(lc UnixListenerConf) error

func (*StreamingService) Listen

func (s *StreamingService) Listen() (err error)

func (*StreamingService) SetConf

func (s *StreamingService) SetConf(sc []conf.TCPSourceConfig, pc []conf.ParserConfig, queueSize uint64, messageSize int)

type TCPListenerConf

type TCPListenerConf struct {
	Listener net.Listener
	Port     int
	Conf     conf.TCPSourceConfig
}

type TcpServiceImpl

type TcpServiceImpl struct {
	StreamingService
	// contains filtered or unexported fields
}

func NewTcpService

func NewTcpService(env *base.ProviderEnv) (*TcpServiceImpl, error)

func (*TcpServiceImpl) FatalError

func (s *TcpServiceImpl) FatalError() chan struct{}

func (*TcpServiceImpl) Gather

func (s *TcpServiceImpl) Gather() ([]*dto.MetricFamily, error)

Gather asks the TCP service to report metrics

func (*TcpServiceImpl) SetConf

func (s *TcpServiceImpl) SetConf(c conf.BaseConfig)

SetConf configures the TCP service

func (*TcpServiceImpl) Shutdown

func (s *TcpServiceImpl) Shutdown()

Shutdown is just Stop for the TCP service

func (*TcpServiceImpl) Start

func (s *TcpServiceImpl) Start() ([]model.ListenerInfo, error)

Start makes the TCP service start

func (*TcpServiceImpl) Stop

func (s *TcpServiceImpl) Stop()

Stop makes the TCP service stop

func (*TcpServiceImpl) Type

func (s *TcpServiceImpl) Type() base.Types

type UdpServiceImpl

type UdpServiceImpl struct {
	base.BaseService
	UdpConfigs []conf.UDPSourceConfig
	// contains filtered or unexported fields
}

func NewUdpService

func NewUdpService(env *base.ProviderEnv) (*UdpServiceImpl, error)

func (*UdpServiceImpl) FatalError

func (s *UdpServiceImpl) FatalError() chan struct{}

func (*UdpServiceImpl) Gather

func (s *UdpServiceImpl) Gather() ([]*dto.MetricFamily, error)

func (*UdpServiceImpl) ListenPacket

func (s *UdpServiceImpl) ListenPacket(c chan model.ListenerInfo)

func (*UdpServiceImpl) Parse

func (s *UdpServiceImpl) Parse() error

Parse fetch messages from the raw queue, parse them, and push them to be sent.

func (*UdpServiceImpl) ParseOne

func (s *UdpServiceImpl) ParseOne(raw *model.RawUDPMessage, gen *utils.Generator) error

func (*UdpServiceImpl) SetConf

func (s *UdpServiceImpl) SetConf(c conf.BaseConfig)

func (s *UdpServiceImpl) SetConf(sc []conf.UDPSourceConfig, pc []conf.ParserConfig, queueSize uint64) {

func (*UdpServiceImpl) Shutdown

func (s *UdpServiceImpl) Shutdown()

func (*UdpServiceImpl) Start

func (s *UdpServiceImpl) Start() ([]model.ListenerInfo, error)

func (*UdpServiceImpl) Stop

func (s *UdpServiceImpl) Stop()

func (*UdpServiceImpl) Type

func (s *UdpServiceImpl) Type() base.Types

type UnixListenerConf

type UnixListenerConf struct {
	Listener net.Listener
	Conf     conf.TCPSourceConfig
}

Jump to

Keyboard shortcuts

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