Files
Link-Log/backend/app/plugins/base.py
T
olaf 495d5c3907
Build LinkLog Development Image / development-image (push) Successful in 38s
Vibe generated documentation
2026-09-04 16:10:34 +02:00

26 lines
805 B
Python

## Copyright © 2026 Olaf Kolkman
## SPDX-License-Identifier: GPL-3.0-or-later
class BasePlugin:
"""Define the interface shared by LinkLog event plugins."""
name = 'base'
version = '1.0.0'
enabled = True
def initialize(self, config=None):
"""Apply plugin configuration and report whether initialization succeeded."""
return True
def validate_config(self, config):
"""Validate configuration and return a ``(valid, message)`` pair."""
return True, 'ok'
def handle_event(self, event):
"""Handle a LinkLog event; subclasses must provide the implementation."""
raise NotImplementedError
def health_check(self):
"""Return the plugin name and basic health status."""
return {'name': self.name, 'status': 'ok'}