Options
All
  • Public
  • Public/Protected
  • All
Menu

If lambda Timeout (Ifto) main class.

export
class

Ifto

Hierarchy

  • Ifto

Index

Constructors

constructor

  • Creates an instance of Ifto.

    memberof

    Ifto

    Returns Ifto

Properties

Private allowedToMonitor

allowedToMonitor: boolean = false

flag indicates monitoring should enable or not

memberof

Ifto

Private flushLogsWhenDifferenceLessThanMilliseconds

flushLogsWhenDifferenceLessThanMilliseconds: number

This holds minimum time difference (in milliseconds) value to flush the logs.

Lambda context contains 'getRemainingTimeInMillis()' function which give how many milliseconds left for execution. flushLogsWhenDifferenceLessThanMilliseconds defines minimum milliseconds left, before flushing logs. Eg: if (context.getRemainingTimeInMillis() <= flushLogsWhenDifferenceLessThanMilliseconds) { flush the logs }

type

{number}

memberof

Ifto

Private Optional lambdaContext

lambdaContext: Context

Holds the lambda Context object

type

{Context}

memberof

Ifto

Private logEntries

logEntries: string[] = []

Holds the log entries

type

{string[]}

memberof

Ifto

Private output

Holds the output function

type

{OutputFunction}

memberof

Ifto

Methods

addLambdaContext

  • addLambdaContext(lambdaContext: Context): this
  • Add Lambda function context

    memberof

    Ifto

    Parameters

    • lambdaContext: Context

    Returns this

attach

Private clearMonitoringInterval

  • clearMonitoringInterval(interval?: NodeJS.Timeout): void
  • Clear

    memberof

    Ifto

    Parameters

    • Optional interval: NodeJS.Timeout

    Returns void

getFlushLogsWhenDifferenceLessThanMilliseconds

  • getFlushLogsWhenDifferenceLessThanMilliseconds(): number
  • Get value for flushLogsWhenDifferenceLessThanMilliseconds

    memberof

    Ifto

    Returns number

getLambdaContext

  • getLambdaContext(): undefined | Context
  • Return lambda Context

    memberof

    Ifto

    Returns undefined | Context

getLogEntries

  • getLogEntries(): string[]
  • Get log entries

    memberof

    Ifto

    Returns string[]

Private getLogEntry

  • getLogEntry(logArray: string[], entry: string): string
  • Get formated log entry

    memberof

    Ifto

    Parameters

    • logArray: string[]
    • entry: string

    Returns string

getOutputFunction

  • getOutputFunction(): function
  • Get output function

    memberof

    Ifto

    Returns function

      • (...arg: any[]): void
      • Parameters

        • Rest ...arg: any[]

        Returns void

Private getValueFromProcessEnv

  • getValueFromProcessEnv(params: ProcessEnv, valueKey: string): undefined | string
  • try to extract lower case or upper case values

    memberof

    Ifto

    Parameters

    • params: ProcessEnv
    • valueKey: string

    Returns undefined | string

Private getWarningString

  • getWarningString(): string
  • Get the warning header

    memberof

    Ifto

    Returns string

init

  • init(params: ProcessEnv): this
  • Initialize the Ifto process

    memberof

    Ifto

    Parameters

    • params: ProcessEnv

    Returns this

isAllowedToMonitor

  • isAllowedToMonitor(): boolean
  • Indicates whether the monitoring should start or not

    memberof

    Ifto

    Returns boolean

log

  • log(entry: string): this
  • Log data

    memberof

    Ifto

    Parameters

    • entry: string

    Returns this

monitor

  • monitor(handler: Promise<any>): Promise<any>
  • Start monitoring

    memberof

    Ifto

    Parameters

    • handler: Promise<any>

    Returns Promise<any>

updateOutputFunction

Static getInstance

  • getInstance(): Ifto
  • Get instance of Ifto

    static
    memberof

    Ifto

    Returns Ifto

Legend

  • Module
  • Object literal
  • Variable
  • Function
  • Function with type parameter
  • Index signature
  • Type alias
  • Enumeration
  • Enumeration member
  • Property
  • Method
  • Interface
  • Interface with type parameter
  • Constructor
  • Property
  • Method
  • Index signature
  • Class
  • Class with type parameter
  • Constructor
  • Property
  • Method
  • Accessor
  • Index signature
  • Inherited constructor
  • Inherited property
  • Inherited method
  • Inherited accessor
  • Protected property
  • Protected method
  • Protected accessor
  • Private property
  • Private method
  • Private accessor
  • Static property
  • Static method

Generated using TypeDoc