fileoutput

package
v0.0.0-...-489b733 Latest Latest
Warning

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

Go to latest
Published: Mar 4, 2024 License: NIST-PD-fallback Imports: 13 Imported by: 0

Documentation

Overview

Package fileoutput saves captured NDN trafic to files.

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func Open

func Open(ndjsonFilename, pcapngFilename string) (ro ndntdump.RecordOutput, e error)

Open creates RecordOutput that writes to ndjson and pcapng files.

Types

type LogrotateOutput

type LogrotateOutput[T ndntdump.RecordOutput] struct {
	// contains filtered or unexported fields
}

LogrotateOutput wraps a file-based RecordOutput to reopen the file upon SIGHUP.

func NewLogrotateOutput

func NewLogrotateOutput[T ndntdump.RecordOutput](filename string, create func(string) (T, error)) (o *LogrotateOutput[T], e error)

NewLogrotateOutput creates LogrotateOutput.

func (*LogrotateOutput[T]) Close

func (o *LogrotateOutput[T]) Close() error

func (*LogrotateOutput[T]) Write

func (o *LogrotateOutput[T]) Write(rec ndntdump.Record) error

type NdjsonOutput

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

NdjsonOutput saves packet information in Newline delimited JSON (NDJSON) file.

func NewNdjsonOutput

func NewNdjsonOutput(filename string) (o *NdjsonOutput, e error)

NewNdjsonOutput creates NdjsonOutput.

func (*NdjsonOutput) Close

func (o *NdjsonOutput) Close() error

func (*NdjsonOutput) Write

func (o *NdjsonOutput) Write(rec ndntdump.Record) error

type PcapngOutput

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

PcapngOutput saves packet bytes in pcapng file.

func NewPcapngOutput

func NewPcapngOutput(filename string) (o *PcapngOutput, e error)

NewPcapngOutput creates PcapngOutput.

func (*PcapngOutput) Close

func (o *PcapngOutput) Close() error

func (*PcapngOutput) Write

func (o *PcapngOutput) Write(rec ndntdump.Record) error

Jump to

Keyboard shortcuts

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