rfc5424test

package
v0.0.0-...-c3b650e Latest Latest
Warning

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

Go to latest
Published: Mar 19, 2021 License: LGPL-3.0 Imports: 5 Imported by: 0

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 Message

type Message struct {
	RemoteAddr string
	Message    string
}

Message contains the content and origin address of an RFC5424 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

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

func (s *Server) Close()

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

func (*Server) Start

func (s *Server) Start()

Start starts the server listening for client connections.

func (*Server) StartTLS

func (s *Server) StartTLS()

StartTLS starts the server listening for client connections using TLS.

Jump to

Keyboard shortcuts

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