Documentation
¶
Overview ¶
Package fsin contains the fsIn node implementation.
Index ¶
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
This section is empty.
Types ¶
type FsInConfig ¶
type FsInConfig struct {
// Location is the directory to poll: a local path or an
// sftp://user@host/path or ftp://… locator.
Location string `json:"location"`
// Interval is the poll period in seconds (default 5).
Interval float64 `json:"interval"`
// Format selects the emitted payload: "utf8" (default, file
// contents as string) | "binary" ([]byte) | "path" (locator path
// only — pairs with a downstream reader).
Format string `json:"format"`
// Delete removes each file after it is emitted (Switch's
// "leave file" toggle, inverted: receive-and-consume).
Delete bool `json:"delete"`
// Pattern, when set, is a glob matched against file base names
// (e.g. "*.xml"); empty accepts every file.
Pattern string `json:"pattern"`
// Credentials for remote locators (see FsCredentials). Password
// is credential-typed.
Password string `json:"password"`
KeyFile string `json:"keyFile"`
HostKey string `json:"hostKey"`
AcceptAnyHostKey bool `json:"acceptAnyHostKey"`
}
FsInConfig holds the fsIn node configuration.
type FsInNode ¶
FsInNode polls a directory locator and emits one message per new file (Stopper lifecycle like watch/inject).
func NewFsInNode ¶
func NewFsInNode(node nodestore.NodeInterface, config *FsInConfig, host nodebase.NodeHost) *FsInNode
NewFsInNode creates a new fsIn node.
func (*FsInNode) Execute ¶
func (n *FsInNode) Execute(ctx context.Context, input nodestore.MessageInterface) (nodestore.MessageInterface, error)
Execute opens the locator and starts the polling goroutine. The returned payload is a status message (like watch); file messages flow through host.emit as polls find them.