Documentation
¶
Overview ¶
Syslog server library for go, build easy your custom syslog server over UDP, TCP or Unix sockets using RFC3164 or RFC5424
Index ¶
- type ChannelHandler
- type Format
- type Handler
- type LogPartsChannel
- type ScanCloser
- type Server
- func (self *Server) Boot() error
- func (self *Server) GetLastError() error
- func (self *Server) Kill() error
- func (self *Server) ListenTCP(addr string) error
- func (self *Server) ListenUDP(addr string) error
- func (self *Server) ListenUnixgram(addr string) error
- func (self *Server) SetFormat(format Format)
- func (self *Server) SetHandler(handler Handler)
- func (self *Server) SetTimeout(millseconds int64)
- func (self *Server) Wait()
- type TimeoutCloser
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
This section is empty.
Types ¶
type ChannelHandler ¶
type ChannelHandler struct {
// contains filtered or unexported fields
}
The ChannelHandler will send all the syslog entries into the given channel
func NewChannelHandler ¶
func NewChannelHandler(channel LogPartsChannel) *ChannelHandler
NewChannelHandler returns a new ChannelHandler
func (*ChannelHandler) Handle ¶
func (self *ChannelHandler) Handle(logParts syslogparser.LogParts, messageLength int64, err error)
Syslog entry receiver
func (*ChannelHandler) SetChannel ¶
func (self *ChannelHandler) SetChannel(channel LogPartsChannel)
The channel to be used
type Format ¶
type Format int
const ( RFC3164 Format = 1 + iota // RFC3164: http://www.ietf.org/rfc/rfc3164.txt RFC5424 // RFC5424: http://www.ietf.org/rfc/rfc5424.txt RFC6587 // RFC6587: http://www.ietf.org/rfc/rfc6587.txt )
type Handler ¶
type Handler interface {
Handle(syslogparser.LogParts, int64, error)
}
The handler receive every syslog entry at Handle method
type LogPartsChannel ¶
type LogPartsChannel chan syslogparser.LogParts
type ScanCloser ¶
type Server ¶
type Server struct {
// contains filtered or unexported fields
}
func (*Server) ListenUnixgram ¶
Configure the server for listen on an unix socket
func (*Server) SetHandler ¶
Sets the handler, this handler with receive every syslog entry
func (*Server) SetTimeout ¶
Sets the connection timeout for TCP connections, in milliseconds
Click to show internal directories.
Click to hide internal directories.