mirror of
https://github.com/wneessen/logranger.git
synced 2024-11-26 14:45:08 +01:00
Winni Neessen
b6f6b6a664
Introduced an Actions interface for plugins in 'action.go' and implemented a corresponding registry in 'registry.go'. Additionally, adjusted rule related behavior in 'Server' to account for actions, with relevant new fields in Ruleset and Rule. This enables multiple actions on a log message based on defined rules and further modularises the codebase, paving the path for addition of more plugin actions.
18 lines
538 B
Go
18 lines
538 B
Go
// SPDX-FileCopyrightText: 2023 Winni Neessen <wn@neessen.dev>
|
|
//
|
|
// SPDX-License-Identifier: MIT
|
|
|
|
package plugins
|
|
|
|
import (
|
|
"github.com/wneessen/go-parsesyslog"
|
|
)
|
|
|
|
// Action is an interface that defines the behavior of an action to be performed
|
|
// on a log message.
|
|
//
|
|
// The Process method takes a log message, a slice of match groups, and a
|
|
// configuration map, and returns an error if any occurs during processing.
|
|
type Action interface {
|
|
Process(logmessage parsesyslog.LogMsg, matchgroup []string, confmap map[string]any) error
|
|
}
|