podman
1package events
2
3import (
4"context"
5"errors"
6)
7
8// EventToNull is an eventer type that does nothing.
9// It is meant for unit tests only
10type EventToNull struct{}
11
12// Write eats the event and always returns nil
13func (e EventToNull) Write(ee Event) error {
14return nil
15}
16
17// Read does nothing and returns an error.
18func (e EventToNull) Read(ctx context.Context, options ReadOptions) error {
19return errors.New("cannot read events with the \"none\" backend")
20}
21
22// newNullEventer returns a new null eventer. You should only do this for
23// the purposes of internal libpod testing.
24func newNullEventer() Eventer {
25return EventToNull{}
26}
27
28// String returns a string representation of the logger
29func (e EventToNull) String() string {
30return "none"
31}
32