diff options
author | Doug Rabson <dfr@rabson.org> | 2022-08-11 11:19:40 +0100 |
---|---|---|
committer | Doug Rabson <dfr@rabson.org> | 2022-08-22 10:14:12 +0100 |
commit | 8ffeb626c918b9b9329a8bda5e5579169e323bdf (patch) | |
tree | e834d7ff58ed4ca921d19375f1f49e2b70a2452d /libpod/events | |
parent | 8aa29fd54f4fbcc4feebdc234c1c5cb454173a7f (diff) | |
download | podman-8ffeb626c918b9b9329a8bda5e5579169e323bdf.tar.gz podman-8ffeb626c918b9b9329a8bda5e5579169e323bdf.tar.bz2 podman-8ffeb626c918b9b9329a8bda5e5579169e323bdf.zip |
events: Add freebsd support for libpod/event
[NO NEW TESTS NEEDED]
Signed-off-by: Doug Rabson <dfr@rabson.org>
Diffstat (limited to 'libpod/events')
-rw-r--r-- | libpod/events/events_freebsd.go | 23 | ||||
-rw-r--r-- | libpod/events/events_unsupported.go | 4 | ||||
-rw-r--r-- | libpod/events/logfile.go | 4 |
3 files changed, 27 insertions, 4 deletions
diff --git a/libpod/events/events_freebsd.go b/libpod/events/events_freebsd.go new file mode 100644 index 000000000..17d410089 --- /dev/null +++ b/libpod/events/events_freebsd.go @@ -0,0 +1,23 @@ +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(LogFile.String()): + return EventLogFile{options}, nil + case strings.ToUpper(Null.String()): + return NewNullEventer(), nil + case strings.ToUpper(Memory.String()): + return NewMemoryEventer(), nil + default: + return nil, fmt.Errorf("unknown event logger type: %s", strings.ToUpper(options.EventerType)) + } +} diff --git a/libpod/events/events_unsupported.go b/libpod/events/events_unsupported.go index d766402a9..01031c225 100644 --- a/libpod/events/events_unsupported.go +++ b/libpod/events/events_unsupported.go @@ -1,5 +1,5 @@ -//go:build !linux -// +build !linux +//go:build !linux && !freebsd +// +build !linux,!freebsd package events diff --git a/libpod/events/logfile.go b/libpod/events/logfile.go index c7dbf4850..519e16629 100644 --- a/libpod/events/logfile.go +++ b/libpod/events/logfile.go @@ -1,5 +1,5 @@ -//go:build linux -// +build linux +//go:build linux || freebsd +// +build linux freebsd package events |