mirror of
https://github.com/ScuroNeko/mtg.git
synced 2026-08-31 19:04:02 +03:00
Simplify internals
This commit is contained in:
+3
-1
@@ -8,6 +8,8 @@ import (
|
||||
"github.com/9seconds/mtg/wrappers"
|
||||
)
|
||||
|
||||
var Direct = newDirectTelegram()
|
||||
|
||||
const (
|
||||
directV4DefaultIdx conntypes.DC = 1
|
||||
directV6DefaultIdx conntypes.DC = 1
|
||||
@@ -48,7 +50,7 @@ func (d *directTelegram) Dial(ctx context.Context,
|
||||
return d.baseTelegram.dial(ctx, cancel, dc-1, protocol)
|
||||
}
|
||||
|
||||
func NewDirectTelegram() Telegram {
|
||||
func newDirectTelegram() Telegram {
|
||||
return &directTelegram{
|
||||
baseTelegram: baseTelegram{
|
||||
dialer: net.Dialer{Timeout: telegramDialTimeout},
|
||||
|
||||
@@ -16,6 +16,8 @@ import (
|
||||
|
||||
const middleTelegramBackgroundUpdateEvery = time.Hour
|
||||
|
||||
var Middle = NewMiddleTelegram()
|
||||
|
||||
type middleTelegram struct {
|
||||
baseTelegram
|
||||
|
||||
|
||||
Reference in New Issue
Block a user