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
Você não pode selecionar mais de 25 tópicos Os tópicos devem começar com uma letra ou um número, podem incluir traços ('-') e podem ter até 35 caracteres.

init.go 312B

123456789101112131415161718192021222324
  1. package hub
  2. import (
  3. "context"
  4. "errors"
  5. "sync"
  6. )
  7. var (
  8. ErrTimeout = errors.New("timeout")
  9. ErrClosed = errors.New("context is closed")
  10. Hub Interface
  11. initOnce sync.Once
  12. )
  13. func Init(ctx context.Context) {
  14. initOnce.Do(func() {
  15. Hub = &hub{
  16. muxes: make(map[int32]*mux),
  17. ctx: ctx,
  18. }
  19. })
  20. }