mirror of
https://github.com/ScuroNeko/mtg.git
synced 2026-08-31 23:44:01 +03:00
FILE / ScuroNeko/mtg
events/noop.go
Исходный файл и его история в репозитории.
29 lines
783 B
Go
29 lines
783 B
Go
package events
|
|
|
|
import (
|
|
"context"
|
|
|
|
"github.com/9seconds/mtg/v2/mtglib"
|
|
)
|
|
|
|
type noop struct{}
|
|
|
|
func (n noop) Send(ctx context.Context, evt mtglib.Event) {}
|
|
func (n noop) Shutdown() {}
|
|
|
|
func NewNoopStream() mtglib.EventStream {
|
|
return noop{}
|
|
}
|
|
|
|
type noopObserver struct{}
|
|
|
|
func (n noopObserver) EventStart(_ mtglib.EventStart) {}
|
|
func (n noopObserver) EventFinish(_ mtglib.EventFinish) {}
|
|
func (n noopObserver) EventConcurrencyLimited(_ mtglib.EventConcurrencyLimited) {}
|
|
func (n noopObserver) EventIPBlocklisted(_ mtglib.EventIPBlocklisted) {}
|
|
func (n noopObserver) Shutdown() {}
|
|
|
|
func NewNoopObserver() Observer {
|
|
return noopObserver{}
|
|
}
|