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
You can not select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.

events.go 582B

123456789101112131415161718192021222324252627282930313233343536373839404142
  1. package mtglib
  2. import (
  3. "net"
  4. "time"
  5. )
  6. type EventStart struct {
  7. CreatedAt time.Time
  8. ConnID string
  9. RemoteIP net.IP
  10. }
  11. func (e EventStart) StreamID() string {
  12. return e.ConnID
  13. }
  14. type EventFinish struct {
  15. CreatedAt time.Time
  16. ConnID string
  17. }
  18. func (e EventFinish) StreamID() string {
  19. return e.ConnID
  20. }
  21. type EventConcurrencyLimited struct {
  22. CreatedAt time.Time
  23. }
  24. func (e EventConcurrencyLimited) StreamID() string {
  25. return ""
  26. }
  27. type EventIPBlocklisted struct {
  28. CreatedAt time.Time
  29. RemoteIP net.IP
  30. }
  31. func (e EventIPBlocklisted) StreamID() string {
  32. return ""
  33. }