rfc: github.com/juju/rfc/rfc5424/rfc5424test Index | Files

package rfc5424test

import "github.com/juju/rfc/rfc5424/rfc5424test"

Package rc5424test provides utilities for testing RFC 5424.

Index

Package Files

doc.go server.go

type Handler Uses

type Handler interface {
    HandleSyslog(Message Message)
}

Handler defines an interface for handling RFC5424 messages.

type HandlerFunc Uses

type HandlerFunc func(Message)

HandlerFunc is a Handler that is implemented as a function.

func (HandlerFunc) HandleSyslog Uses

func (f HandlerFunc) HandleSyslog(m Message)

type Message Uses

type Message struct {
    RemoteAddr string
    Message    string
}

Message contains the content and origin address of an RFC5424 message.

type Server Uses

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 Uses

func NewServer(handler Handler) *Server

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 Uses

func (s *Server) Close()

Close closes any client connections, and stops the server from accepting any new ones.

func (*Server) Start Uses

func (s *Server) Start()

Start starts the server listening for client connections.

func (*Server) StartTLS Uses

func (s *Server) StartTLS()

StartTLS starts the server listening for client connections using TLS.

Package rfc5424test imports 5 packages (graph). Updated 2016-08-02. Refresh now. Tools for package owners. This is an inactive package (no imports and no commits in at least two years).