mirror of
https://github.com/containers/podman.git
synced 2025-12-01 10:38:05 +08:00
This type is unsused, undocumented and basically broken. If this would
be used anywhere it will just deadlock after writing 100+ events without
reading as the channel will just be full.
It was added in commit 8da5f3f733 but never used there nor is there any
justification why this was added in the commit message or PR comments.
Signed-off-by: Paul Holzinger <pholzing@redhat.com>
28 lines
753 B
Go
28 lines
753 B
Go
package events
|
|
|
|
import (
|
|
"fmt"
|
|
"strings"
|
|
|
|
"github.com/sirupsen/logrus"
|
|
)
|
|
|
|
// NewEventer creates an eventer based on the eventer type
|
|
func NewEventer(options EventerOptions) (Eventer, error) {
|
|
logrus.Debugf("Initializing event backend %s", options.EventerType)
|
|
switch strings.ToUpper(options.EventerType) {
|
|
case strings.ToUpper(Journald.String()):
|
|
eventer, err := newEventJournalD(options)
|
|
if err != nil {
|
|
return nil, fmt.Errorf("eventer creation: %w", err)
|
|
}
|
|
return eventer, nil
|
|
case strings.ToUpper(LogFile.String()):
|
|
return newLogFileEventer(options)
|
|
case strings.ToUpper(Null.String()):
|
|
return newNullEventer(), nil
|
|
default:
|
|
return nil, fmt.Errorf("unknown event logger type: %s", strings.ToUpper(options.EventerType))
|
|
}
|
|
}
|