#include <stddef.h>
#include <stdint.h>
#include <time.h>
Go to the source code of this file.
◆ trafilo_event_free_fn
| typedef void(* trafilo_event_free_fn) (event_t *event) |
Free a user allocated event from memory.
- Parameters
-
◆ trafilo_handle_fn
| typedef void(* trafilo_handle_fn) (const event_t *event, void *user_state) |
Handling callback function provided by user.
- Parameters
-
| event | Event to be handled. |
| user_state | Bucket's state pointer. |
◆ trafilo_parse_fn
| typedef int(* trafilo_parse_fn) (const char *raw, size_t len, event_t **out) |
Parse and fillout **out with a fresh event_t.
- Parameters
-
| raw | Raw log entry from stream. |
| len | Length of the raw entry. |
| out | New parsed entry along with event data. |
- Returns
- 0 on success, -1 to drop entry.
◆ trafilo_sink_fn
| typedef void(* trafilo_sink_fn) (const char *key, const window_result_t *result, void *user_state) |
Sink window callback.
- Parameters
-
| key | Bucket identifier (service identifier). |
| result | Window result snapshot. |
| user_state | Bucket's state pointer. |
◆ trafilo_state_free_fn
| typedef void(* trafilo_state_free_fn) (void *user_state) |
Free the user defined state, when a bucket is evicted.
- Parameters
-
| user_state | State to be freed. |
◆ trafilo_state_init_fn
| typedef void *(* trafilo_state_init_fn) (const char *key) |
Initialize the state of a bucket, called the first time a key is seen.
- Parameters
-
- Returns
- Pointer to initialized state.
◆ trafilo_create()
Create a framework instance.
- Parameters
-
| config | Pointer to the configuration struct. |
- Returns
- New trafilo_t* on success, NULL on invalid config or alloc failure.
◆ trafilo_destroy()
| void trafilo_destroy |
( |
trafilo_t * | t | ) |
|
Free all resources.
- Parameters
-
◆ trafilo_emit()
| int trafilo_emit |
( |
trafilo_t * | t, |
|
|
const char * | raw, |
|
|
size_t | len ) |
Push a raw line into the framework's queue, bypassing the socket.
- Parameters
-
| t | The framework instance. |
| raw | Raw line data. |
| len | Length of the raw line. |
- Returns
- 0 on success, -1 if queue full or framework shutting down.
◆ trafilo_run()
| int trafilo_run |
( |
trafilo_t * | trafilo | ) |
|
Run the framework. Blocks until trafilo_shutdown() is called.
- Parameters
-
- Returns
- 0 on clean shutdown, non-zero on error.
◆ trafilo_shutdown()
| void trafilo_shutdown |
( |
trafilo_t * | trafilo | ) |
|
Signal the framework to shut down.
- Parameters
-