podman

Форк
0
/
nullout.go 
31 строка · 748.0 Байт
1
package events
2

3
import (
4
	"context"
5
	"errors"
6
)
7

8
// EventToNull is an eventer type that does nothing.
9
// It is meant for unit tests only
10
type EventToNull struct{}
11

12
// Write eats the event and always returns nil
13
func (e EventToNull) Write(ee Event) error {
14
	return nil
15
}
16

17
// Read does nothing and returns an error.
18
func (e EventToNull) Read(ctx context.Context, options ReadOptions) error {
19
	return 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.
24
func newNullEventer() Eventer {
25
	return EventToNull{}
26
}
27

28
// String returns a string representation of the logger
29
func (e EventToNull) String() string {
30
	return "none"
31
}
32

Использование cookies

Мы используем файлы cookie в соответствии с Политикой конфиденциальности и Политикой использования cookies.

Нажимая кнопку «Принимаю», Вы даете АО «СберТех» согласие на обработку Ваших персональных данных в целях совершенствования нашего веб-сайта и Сервиса GitVerse, а также повышения удобства их использования.

Запретить использование cookies Вы можете самостоятельно в настройках Вашего браузера.