Documentation
¶
Overview ¶
Package fsout contains the fsOut node implementation.
Index ¶
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
This section is empty.
Types ¶
type FsOutConfig ¶
type FsOutConfig struct {
// Location is the target DIRECTORY locator: a local path or
// sftp:// / ftp:// URI. The written file lives at
// location/filename.
Location string `json:"location"`
// Filename is the base name to write (fixed mode); with
// FilenameType "msg" the message's filename property is used —
// a full msg filename is reduced to its base name so a remote
// path cannot escape the locator dir.
Filename string `json:"filename"`
FilenameType string `json:"filenameType"`
// AppendNewline appends \n to every written payload.
AppendNewline bool `json:"appendNewline"`
// OverwriteFile: "true" (default) truncates, "false" appends,
// "delete" removes the file first then writes fresh.
OverwriteFile string `json:"overwriteFile"`
// CreateDir creates missing locator directories (mkdir -p).
CreateDir bool `json:"createDir"`
// Encoding decodes a string payload before writing (same values
// as the file node).
Encoding string `json:"encoding"`
// Credentials for remote locators; Password is credential-typed.
Password string `json:"password"`
KeyFile string `json:"keyFile"`
HostKey string `json:"hostKey"`
}
FsOutConfig holds the fsOut node configuration — the remote-capable sibling of FileConfig.
type FsOutNode ¶
FsOutNode writes the payload to a file under a dir locator, then passes the message through with the resolved path in Metadata. The Fs is opened per message and closed after the write — remote delivery is a per-item dial (Switch's send model); volume flows should prefer the file node on a mount.
func NewFsOutNode ¶
func NewFsOutNode(node nodestore.NodeInterface, config *FsOutConfig, host nodebase.NodeHost) *FsOutNode
NewFsOutNode creates a new fsOut node.
func (*FsOutNode) Execute ¶
func (n *FsOutNode) Execute(ctx context.Context, input nodestore.MessageInterface) (nodestore.MessageInterface, error)
Execute resolves the target, writes via tmp+rename, and stamps the resolved locator path into Metadata["filename"].