Documentation
¶
Overview ¶
Syslog server library for go, build easy your custom syslog server over UDP, TCP or Unix sockets using RFC3164, RFC5424 and RFC6587
Index ¶
- Variables
- type ChannelHandler
- type DatagramMessage
- type Handler
- type HandshakeError
- type ListenerError
- type LogPartsChannel
- type ParserError
- type ScanCloser
- type ScannerError
- type Server
- func (s *Server) Boot() error
- func (s *Server) GetLastError() error
- func (s *Server) Kill() error
- func (s *Server) ListenTCP(addr string) error
- func (s *Server) ListenTCPTLS(addr string, config *tls.Config) error
- func (s *Server) ListenUDP(addr string) error
- func (s *Server) ListenUnixgram(addr string) error
- func (s *Server) SetDatagramChannelSize(size int)
- func (s *Server) SetDatagramReadBufferSize(size int)
- func (s *Server) SetErrChannel(c chan error)
- func (s *Server) SetFormat(f format.Format)
- func (s *Server) SetHandler(handler Handler)
- func (s *Server) SetTimeout(millseconds int64)
- func (s *Server) SetTlsHandshakeTimeout(d time.Duration)
- func (s *Server) SetTlsPeerNameFunc(tlsPeerNameFunc TlsPeerNameFunc)
- func (s *Server) Wait()
- type TimeoutCloser
- type TlsPeerNameFunc
Constants ¶
This section is empty.
Variables ¶
var ( RFC3164 = &format.RFC3164{} // RFC3164: http://www.ietf.org/rfc/rfc3164.txt RFC5424 = &format.RFC5424{} // RFC5424: http://www.ietf.org/rfc/rfc5424.txt RFC6587 = &format.RFC6587{} // RFC6587: http://www.ietf.org/rfc/rfc6587.txt - octet counting variant Automatic = &format.Automatic{} // Automatically identify the format )
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 (h *ChannelHandler) Handle(logParts format.LogParts, messageLength int64, err error)
Syslog entry receiver
func (*ChannelHandler) SetChannel ¶
func (h *ChannelHandler) SetChannel(channel LogPartsChannel)
The channel to be used
type DatagramMessage ¶
type DatagramMessage struct {
// contains filtered or unexported fields
}
type HandshakeError ¶
type HandshakeError struct {
RemoteAddr net.Addr
ConnectionState tls.ConnectionState
// contains filtered or unexported fields
}
func (*HandshakeError) Error ¶
func (l *HandshakeError) Error() string
func (*HandshakeError) Unwrap ¶
func (l *HandshakeError) Unwrap() error
type ListenerError ¶
type ListenerError struct {
// contains filtered or unexported fields
}
Error types
func (*ListenerError) Error ¶
func (l *ListenerError) Error() string
func (*ListenerError) Unwrap ¶
func (l *ListenerError) Unwrap() error
type LogPartsChannel ¶
type ParserError ¶
type ParserError struct {
// contains filtered or unexported fields
}
func (*ParserError) Error ¶
func (l *ParserError) Error() string
func (*ParserError) Unwrap ¶
func (l *ParserError) Unwrap() error
type ScanCloser ¶
type ScannerError ¶
func (*ScannerError) Error ¶
func (l *ScannerError) Error() string
func (*ScannerError) Unwrap ¶
func (l *ScannerError) Unwrap() error
type Server ¶
type Server struct {
// contains filtered or unexported fields
}
func (*Server) ListenTCPTLS ¶
Configure the server for listen on a TCP addr for TLS
func (*Server) ListenUnixgram ¶
Configure the server for listen on an unix socket
func (*Server) SetDatagramChannelSize ¶
func (*Server) SetDatagramReadBufferSize ¶
Sets datagram read buffer size
func (*Server) SetErrChannel ¶
Sets a channel for errors
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
func (*Server) SetTlsHandshakeTimeout ¶
func (*Server) SetTlsPeerNameFunc ¶
func (s *Server) SetTlsPeerNameFunc(tlsPeerNameFunc TlsPeerNameFunc)
Set the function that extracts a TLS peer name from the TLS connection