file

package
v0.9.2 Latest Latest
Warning

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

Go to latest
Published: Dec 23, 2025 License: GPL-3.0 Imports: 11 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func FormatLine

func FormatLine(line Line) string

FormatLine returns a string representing a Line, ready for writing to file

func Run

func Run(ctx context.Context, hup chan os.Signal, connected chan struct{}, session, token, filename string, binary bool) error

Run connects to the session and handles writing to/from files If a playfilename is present, the connection is closed once the file has finished playing A long delay can be left at the end of the playfile to keep the connection open and logging Connections without a playfilename are kept open indefinitely. interval sets how often the condition check timeout is checked - this has a small effect on CPU usage, and can be set at say 10ms for testing, or 1s or more for usage with long collection periods

func Write

func Write(ctx context.Context, in chan Line, w io.Writer)

Write writes the line to the file, after formatting, returning when the context is cancelled, or the in channel is closed.

func WriteBinary added in v0.8.0

func WriteBinary(ctx context.Context, in chan reconws.WsMessage, w io.Writer)

Write writes the line to the file, after formatting, returning when the context is cancelled, or the in channel is closed.

func WsMessageToLine

func WsMessageToLine(ctx context.Context, in chan reconws.WsMessage, out chan Line)

WsMessageToLine converts reconws.WsMessage to Line format, adding a timestamp.

Types

type Line

type Line struct {
	Time    time.Time
	Content string
}

Line represents content of a line received from the relay and the time it was received.

Jump to

Keyboard shortcuts

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