logreceiver

package
v0.3.7 Latest Latest
Warning

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

Go to latest
Published: May 14, 2024 License: MPL-2.0 Imports: 9 Imported by: 1

Documentation

Overview

Package logreceiver implements JSON-over-TCP log receiver.

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type Handler

type Handler func(srcAddress netip.Addr, msg map[string]interface{})

Handler is called for each received message.

type Server

type Server struct {
	// contains filtered or unexported fields
}

Server implements TCP server to receive JSON logs.

func NewServer

func NewServer(logger *zap.Logger, listener net.Listener, handler Handler) *Server

NewServer initializes new Server.

func (*Server) Serve

func (srv *Server) Serve() error

Serve runs the TCP server loop.

func (*Server) Stop

func (srv *Server) Stop()

Stop serving.

This has a bug that it doesn't close the connections.

Jump to

Keyboard shortcuts

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