summaryrefslogtreecommitdiff
path: root/libpod/events/nullout.go
blob: 7d811a9c718af0947f3afe7843d1677241f86ba8 (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
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
}