mirror of
https://github.com/ScuroNeko/mtg.git
synced 2026-09-01 02:34:02 +03:00
FILE / ScuroNeko/mtg
protocol/interfaces.go
Исходный файл и его история в репозитории.
23 lines
584 B
Go
23 lines
584 B
Go
package protocol
|
|
|
|
import (
|
|
"github.com/9seconds/mtg/conntypes"
|
|
"github.com/9seconds/mtg/telegram"
|
|
"github.com/9seconds/mtg/wrappers"
|
|
)
|
|
|
|
type ClientProtocol interface {
|
|
Handshake(wrappers.StreamReadWriteCloser) (wrappers.StreamReadWriteCloser, error)
|
|
GetConnectionType() conntypes.ConnectionType
|
|
GetConnectionProtocol() conntypes.ConnectionProtocol
|
|
GetDC() conntypes.DC
|
|
}
|
|
|
|
type ClientProtocolMaker func() ClientProtocol
|
|
|
|
type TelegramProtocol interface {
|
|
Handshake(*TelegramRequest) (wrappers.Wrap, error)
|
|
}
|
|
|
|
type TelegramProtocolMaker func(telegram.Telegram) TelegramProtocol
|