Highly-opinionated (ex-bullshit-free) MTPROTO proxy for Telegram. If you use v1.0 or upgrade broke you proxy, please read the chapter Version 2
Du kan inte välja fler än 25 ämnen Ämnen måste starta med en bokstav eller siffra, kan innehålla bindestreck ('-') och vara max 35 tecken långa.

noop.go 1.0KB

12345678910111213141516171819202122232425262728293031
  1. package events
  2. import (
  3. "context"
  4. "github.com/9seconds/mtg/v2/mtglib"
  5. )
  6. type noop struct{}
  7. func (n noop) Send(ctx context.Context, evt mtglib.Event) {}
  8. func (n noop) Shutdown() {}
  9. func NewNoopStream() mtglib.EventStream {
  10. return noop{}
  11. }
  12. type noopObserver struct{}
  13. func (n noopObserver) EventStart(_ mtglib.EventStart) {}
  14. func (n noopObserver) EventConnectedToDC(_ mtglib.EventConnectedToDC) {}
  15. func (n noopObserver) EventDomainFronting(_ mtglib.EventDomainFronting) {}
  16. func (n noopObserver) EventTraffic(_ mtglib.EventTraffic) {}
  17. func (n noopObserver) EventFinish(_ mtglib.EventFinish) {}
  18. func (n noopObserver) EventConcurrencyLimited(_ mtglib.EventConcurrencyLimited) {}
  19. func (n noopObserver) EventIPBlocklisted(_ mtglib.EventIPBlocklisted) {}
  20. func (n noopObserver) Shutdown() {}
  21. func NewNoopObserver() Observer {
  22. return noopObserver{}
  23. }