output

package
v0.9.0 Latest Latest
Warning

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

Go to latest
Published: Apr 17, 2026 License: MIT Imports: 8 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func CreateLogFile

func CreateLogFile(path string) (*os.File, error)

CreateLogFile creates the log file with secure permissions. Returns the file handle for writing.

Types

type CarriageReturnWriter

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

CarriageReturnWriter interprets \r as "move cursor to line start, overwrite". It writes to dst only the final visual state of each line.

func NewCarriageReturnWriter

func NewCarriageReturnWriter(dst io.Writer) *CarriageReturnWriter

NewCarriageReturnWriter creates a new carriage return interpreting writer.

func (*CarriageReturnWriter) Flush

func (w *CarriageReturnWriter) Flush() error

Flush writes any remaining incomplete line (with newline appended).

func (*CarriageReturnWriter) Write

func (w *CarriageReturnWriter) Write(data []byte) (int, error)

Write processes input bytes, interpreting \r as line overwrite.

type FilePath

type FilePath struct {
	Log        string // autoebiten-{PID}-output.log
	Snapshot   string // autoebiten-{PID}-snapshot.log
	LaunchSock string // autoebiten-{PID}-launch.sock
}

FilePath holds the paths for output capture files.

func DerivePaths

func DerivePaths(socketPath string) *FilePath

DerivePaths derives output file paths from a socket path. Socket format: {dir}/autoebiten-{PID}.sock Output files: {dir}/autoebiten-{PID}-output.log

{dir}/autoebiten-{PID}-snapshot.log
{dir}/autoebiten-{PID}-launch.sock

type OutputManager

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

OutputManager coordinates mutex-protected write, diff, and snapshot operations.

func NewOutputManager

func NewOutputManager(logFile *os.File, outputPath, snapshotPath string) *OutputManager

NewOutputManager creates a new output manager.

func (*OutputManager) DiffAndUpdateSnapshot

func (m *OutputManager) DiffAndUpdateSnapshot() (string, error)

DiffAndUpdateSnapshot generates diff between snapshot and log, then copies log to snapshot. Returns the diff string.

func (*OutputManager) Write

func (m *OutputManager) Write(data []byte) (int, error)

Write writes data to the log file with mutex protection and flush.

Jump to

Keyboard shortcuts

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