FileFlinger class Allows to create a file processing service that can be used to watch a folder for new files and send them to a destination (S3, FTP, ...) using pushers. The service can be configured with a pattern to match the file names and generate keys for the destination. Once a file is processed, it can be moved to an archive folder (zipped optionally) or deleted. As a @mdf.js service, it offer prometheus metrics, health checks, and logging.

Hierarchy

  • EventEmitter
    • FileFlinger

Implements

Constructors

Properties

Accessors

Methods

Events

Constructors

Properties

componentId: string = ...

The component identifier

name: string

The name of the instance of the FileFlinger

Accessors

  • get metrics(): Registry<"text/plain; version=0.0.4; charset=utf-8">
  • Return the metrics registry

    Returns Registry<"text/plain; version=0.0.4; charset=utf-8">

  • get status(): "pass" | "fail" | "warn"
  • Overall component status

    Returns "pass" | "fail" | "warn"

Methods

  • Close the file flinger

    Returns Promise<void>

  • Start the file flinger

    Returns Promise<void>

  • Stop the file flinger

    Returns Promise<void>

Events

  • Add a listener for the error event, emitted when the component detects an error.

    Parameters

    • event: "error"

      error event

    • listener: (error: Crash | Multi | Error) => void

      Error event listener

    Returns this

  • Add a listener for the status event, emitted when the component status changes.

    Parameters

    • event: "status"

      status event

    • listener: (status: "pass" | "fail" | "warn") => void

      Status event listener

    Returns this