github.com/containers/libpod@v1.9.4-0.20220419124438-4284fd425507/libpod/events/nullout.go (about) 1 package events 2 3 // EventToNull is an eventer type that only performs write operations 4 // and only writes to /dev/null. It is meant for unittests only 5 type EventToNull struct{} 6 7 // Write eats the event and always returns nil 8 func (e EventToNull) Write(ee Event) error { 9 return nil 10 } 11 12 // Read does nothing. Do not use it. 13 func (e EventToNull) Read(options ReadOptions) error { 14 return nil 15 } 16 17 // NewNullEventer returns a new null eventer. You should only do this for 18 // the purposes on internal libpod testing. 19 func NewNullEventer() Eventer { 20 return EventToNull{} 21 } 22 23 // String returns a string representation of the logger 24 func (e EventToNull) String() string { 25 return "none" 26 }