filein

package
v0.2.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: 9 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 filein contains the fileIn node implementation.

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type FileInConfig

type FileInConfig struct {
	// Filename is the source path (fixed mode); with FilenameType "msg"
	// the message's filename property is used instead
	Filename string `json:"filename"`
	// FilenameType selects the filename source: "fixed" (default) | "msg"
	FilenameType string `json:"filenameType"`
	// Format selects the read mode: "utf8" (default, one string msg) |
	// "lines" (one msg per line with parts metadata) | "stream" (one msg
	// per 64KiB chunk) | "binary" (one []byte msg)
	Format string `json:"format"`
	// SendError emits an error message (Data {error: ...}) for a missing
	// file instead of raising a catchable error
	SendError bool `json:"sendError"`
}

FileInConfig holds configuration for the file in (read) node — the Node-RED `file in` equivalent.

type FileInNode

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

FileInNode reads a file and emits its content. The "lines" and "stream" formats use the MessageExpander hook — Execute stashes the chunks on the instance and Expand tags them with parts metadata so a downstream join node can rebuild the file.

func NewFileInNode

func NewFileInNode(node nodestore.NodeInterface, config *FileInConfig, host nodebase.NodeHost) *FileInNode

NewFileInNode creates a new file in (read) node

func (*FileInNode) Execute

Execute reads the resolved file. For single-message formats the content lands in Data directly; for "lines"/"stream" it is stashed for Expand.

func (*FileInNode) Expand

Expand turns the stashed lines/stream chunks into one message per part, tagged with parts {id, type, index, count, ch} so a join node can reassemble the file.

func (*FileInNode) Validate

func (n *FileInNode) Validate() error

Validate checks the file in node configuration

Jump to

Keyboard shortcuts

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