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.

init.go 705B

1234567891011121314151617181920212223242526272829303132
  1. package mtglib
  2. import (
  3. "context"
  4. "errors"
  5. "net"
  6. "net/http"
  7. "time"
  8. )
  9. var ErrSecretEmpty = errors.New("secret is empty")
  10. type Network interface {
  11. Dial(network, address string) (net.Conn, error)
  12. DialContext(ctx context.Context, network, address string) (net.Conn, error)
  13. MakeHTTPClient(func(ctx context.Context, network, address string) (net.Conn, error)) *http.Client
  14. IdleTimeout() time.Duration
  15. }
  16. type Logger interface {
  17. Named(name string) Logger
  18. BindInt(name string, value int) Logger
  19. BindStr(name, value string) Logger
  20. Info(msg string)
  21. InfoError(msg string, err error)
  22. Warning(msg string)
  23. WarningError(msg string, err error)
  24. Debug(msg string)
  25. DebugError(msg string, err error)
  26. }