feat: Phase 5 — filtres, actions Ntfy, outgoing webhooks, state file
CI / test (push) Successful in 2m34s
CI / test (push) Successful in 2m34s
- Filtres avancés: drop, set_priority, add_tag avec wildcard * (filter_outgoing.v) - Notifications structurées: click_url + actions (ntfy.v + sources/event.v) - Webhook sortant: Slack, Discord, JSON (filter_outgoing.v) - Fichier d'état: persistance poll_state + silence_until (filter_outgoing.v) - Config: sections filters, outgoing, state (config.v) - Tests: 9 nouveaux tests unitaires (filter_outgoing_test.v) - Docs: ROADMAP Phase 5 4/8, version 0.5.0
This commit is contained in:
@@ -340,6 +340,12 @@ fn (mut app App) verify_hmac(payload string, sig_header string) bool {
|
||||
pub fn (mut app App) publish(event sources.Event) {
|
||||
mut e := apply_defaults(event, app.cfg.defaults)
|
||||
|
||||
// v0.5 — Apply filters
|
||||
if !app.apply_filters(mut e) {
|
||||
app.logger.debug('server', 'filter', 'dropped event ${e.source}:${e.name}')
|
||||
return
|
||||
}
|
||||
|
||||
// Check silence
|
||||
now := time.now()
|
||||
if now < app.silence_until {
|
||||
@@ -582,6 +588,9 @@ fn (mut app App) flush_group_buffer() {
|
||||
app.logger.info('server', 'publish',
|
||||
'${e.source}:${e.name} → ${e.topic} (grouped ×${total_count})')
|
||||
app.add_recent_event(now, e, true)
|
||||
|
||||
// v0.5 — Dispatch to outgoing webhooks
|
||||
app.dispatch_outgoing(e)
|
||||
}
|
||||
app.group_buffer = map[string][]GroupEntry{}
|
||||
app.group_last_flush = time.now()
|
||||
|
||||
Reference in New Issue
Block a user