aboutsummaryrefslogtreecommitdiff
path: root/libpod/events/nullout.go
diff options
context:
space:
mode:
Diffstat (limited to 'libpod/events/nullout.go')
-rw-r--r--libpod/events/nullout.go23
1 files changed, 23 insertions, 0 deletions
diff --git a/libpod/events/nullout.go b/libpod/events/nullout.go
new file mode 100644
index 000000000..7d811a9c7
--- /dev/null
+++ b/libpod/events/nullout.go
@@ -0,0 +1,23 @@
+package events
+
+// EventToNull is an eventer type that only performs write operations
+// and only writes to /dev/null. It is meant for unittests only
+type EventToNull struct{}
+
+// Write eats the event and always returns nil
+func (e EventToNull) Write(ee Event) error {
+ return nil
+}
+
+// Read does nothing. Do not use it.
+func (e EventToNull) Read(options ReadOptions) error {
+ return nil
+}
+
+// NewNullEventer returns a new null eventer. You should only do this for
+// the purposes on internal libpod testing.
+func NewNullEventer() Eventer {
+ var e Eventer
+ e = EventToNull{}
+ return e
+}