tail

package
v0.1.0 Latest Latest
Warning

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

Go to latest
Published: Nov 24, 2026 License: MIT Imports: 10 Imported by: 1 module, 0 packages

The first number is the count of modules that contain a package that imports this one. The module count is a better indicator of popularity than the package count. A module with 100 importing packages is counted only once instead of 100 times, reflecting the fact that the choice to use the package was likely made only once, not 100 times.
A '?' means that the value hasn't been computed yet.

Documentation

Overview

Package tail contains the tail node implementation.

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type TailConfig

type TailConfig struct {
	// Filename is the file to follow.
	Filename string `json:"filename"`
	// Filetype selects the emit mode: "text" (default — one message
	// per appended line, Node-RED semantics) or "binary" (one []byte
	// message per appended chunk).
	Filetype string `json:"filetype"`
	// Split is the record separator for text mode (default "\n";
	// escape sequences like \r\n allowed).
	Split string `json:"split"`
	// Interval is the poll period in seconds (default 1).
	Interval float64 `json:"interval"`
	// FromStart reads the existing file content first instead of
	// starting at the end (Node-RED `tail -f` starts at EOF).
	FromStart bool `json:"fromStart"`
}

TailConfig holds configuration for the tail node — the Node-RED `tail` equivalent: it follows a growing file and emits newly appended content.

type TailNode

type TailNode struct {
	*nodebase.BaseNode
	// contains filtered or unexported fields
}

TailNode follows a file's appended content via polling and emits each new line (or binary chunk) downstream. Polling keeps the node cross-platform without an fsnotify dependency.

func NewTailNode

func NewTailNode(node nodestore.NodeInterface, config *TailConfig, host nodebase.NodeHost) *TailNode

NewTailNode creates a new tail node

func (*TailNode) Execute

Execute resolves the file, opens it and starts the polling goroutine from the end (or the start with FromStart).

func (*TailNode) Stop

func (n *TailNode) Stop() error

Stop halts the polling goroutine (idempotent).

func (*TailNode) Validate

func (n *TailNode) Validate() error

Validate checks the tail node configuration

Jump to

Keyboard shortcuts

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