pom-ng:lua
Differences
This shows you the differences between two versions of the page.
| Both sides previous revisionPrevious revisionNext revision | Previous revision | ||
| pom-ng:lua [2013/07/11 13:45] – 136.173.62.129 | pom-ng:lua [2020/05/26 21:59] (current) – external edit 127.0.0.1 | ||
|---|---|---|---|
| Line 9: | Line 9: | ||
| ==== Register an output ==== | ==== Register an output ==== | ||
| - | To create a new output, you simply call **output.new(name, | + | To create a new output, you simply call **output.new(name, |
| - | + | ||
| - | After creating your output | + | |
| When the output is started, the function **open()** will be called. Similarily, the function **close()** will be called when the output is stopped. | When the output is started, the function **open()** will be called. Similarily, the function **close()** will be called when the output is stopped. | ||
| Line 30: | Line 28: | ||
| local param2_value = self: | local param2_value = self: | ||
| print(" | print(" | ||
| - | end | ||
| - | |||
| - | function my_output_register() | ||
| - | pom.output.register(my_output) | ||
| end | end | ||
| Line 176: | Line 170: | ||
| local key, value | local key, value | ||
| key, value = data_iter() | key, value = data_iter() | ||
| - | | + | |
| | | ||
| - | local value_type = type(v) | + | local value_type = type(value) |
| if value_type == " | if value_type == " | ||
| print(" | print(" | ||
| Line 223: | Line 217: | ||
| == Returns: == | == Returns: == | ||
| An output class. | An output class. | ||
| - | |||
| - | === pom.output.register(output_class) === | ||
| - | Registers a new output. | ||
| - | |||
| - | == Parameters: == | ||
| - | * // | ||
| === pom.plugin.new(plugin_name) === | === pom.plugin.new(plugin_name) === | ||
| Line 262: | Line 250: | ||
| Returns a data object containing all the information related to this event. | Returns a data object containing all the information related to this event. | ||
| + | === event.timestsamp === | ||
| + | == Returns: == | ||
| + | Returns the timestamp when the event started in micro seconds since epoch. | ||
| ==== output ==== | ==== output ==== | ||
| Line 269: | Line 260: | ||
| Called when an instance of the output is stopped. This function must be implemented by addon. | Called when an instance of the output is stopped. This function must be implemented by addon. | ||
| - | === output: | + | === output: |
| Call this function to start listening to a particular event. You must call output: | Call this function to start listening to a particular event. You must call output: | ||
| Line 276: | Line 267: | ||
| * // | * // | ||
| * // | * // | ||
| + | * //filter//: String containing an event filter, optional. | ||
| === output: | === output: | ||
| Line 286: | Line 278: | ||
| Called when an instance of the output is started. This function must be implemented by addon. | Called when an instance of the output is started. This function must be implemented by addon. | ||
| - | === output: | + | === output: |
| Start listening to payloads. Every payload will be processed. It's up to the output to filter them. If you don't need a specific function, you can specify nil instead. | Start listening to payloads. Every payload will be processed. It's up to the output to filter them. If you don't need a specific function, you can specify nil instead. | ||
| Line 293: | Line 285: | ||
| * // | * // | ||
| * // | * // | ||
| + | * //filter//: Pload filter to use, optional. | ||
| == Parameters of the above functions: == | == Parameters of the above functions: == | ||
| Line 309: | Line 302: | ||
| ==== pload ==== | ==== pload ==== | ||
| - | |||
| - | === pload.container === | ||
| - | |||
| - | == Returns: == | ||
| - | Returns the pload that was the container of the present pload if any. | ||
| === pload.data === | === pload.data === | ||
| Line 324: | Line 312: | ||
| == Returns: == | == Returns: == | ||
| Returns the event related to this payload. | Returns the event related to this payload. | ||
| + | |||
| + | === pload.filename === | ||
| + | |||
| + | == Returns: == | ||
| + | Returns the pload filename if it has been set, nil otherwise. | ||
| + | |||
| + | === pload.parent === | ||
| + | |||
| + | == Returns: == | ||
| + | Returns the pload that was the parent of the present pload if any. | ||
| === pload.type === | === pload.type === | ||
| Line 357: | Line 355: | ||
| Close the plugin and releases all the associated data. | Close the plugin and releases all the associated data. | ||
| - | === plugin: | + | === plugin: |
| Have the plugin listens to a specific event and process it. | Have the plugin listens to a specific event and process it. | ||
| == Parameters: == | == Parameters: == | ||
| * // | * // | ||
| + | * //filter//: String containing an event filter, optional. | ||
| === plugin: | === plugin: | ||
pom-ng/lua.1373550320.txt.gz · Last modified: (external edit)
