Documentation ¶
Overview ¶
Package rc5424test provides utilities for testing RFC 5424.
Index ¶
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
This section is empty.
Types ¶
type Handler ¶
type Handler interface {
HandleSyslog(Message Message)
}
Handler defines an interface for handling RFC5424 messages.
type HandlerFunc ¶
type HandlerFunc func(Message)
HandlerFunc is a Handler that is implemented as a function.
func (HandlerFunc) HandleSyslog ¶
func (f HandlerFunc) HandleSyslog(m Message)
type Server ¶
type Server struct { Listener net.Listener TLS *tls.Config // contains filtered or unexported fields }
Server is a server for testing the receipt of RFC5424 messages.
func NewServer ¶
NewServer creates a new Server which will invoke the given Handler for received messages. The server will listen for connections on localhost, on an ephemeral port. The listening address can be obtained by inspecting the Server's Listener field.
The Server returned will not listen for connections until Start is called.
func (*Server) Close ¶
func (s *Server) Close()
Close closes any client connections, and stops the server from accepting any new ones.