package transport

Import Path
	github.com/gotd/td/transport (on go.dev)

Dependency Relation
	imports 15 packages, and imported by 4 packages

Involved Source Files codec.go connection.go detect_codec.go Package transport contains different MTProto transport implementations. listener.go obfuscated.go once_close.go protocol.go websocket.go
Package-Level Type Names (total 11, in which 4 are exported)
/* sort exporteds by: | */
Codec is MTProto transport protocol encoding abstraction. Read fills buffer with received message. ReadHeader reads protocol tag if needed. Write encode to writer message from given buffer. WriteHeader sends protocol tag if needed. github.com/gotd/td/internal/proto/codec.Abridged github.com/gotd/td/internal/proto/codec.Codec (interface) *github.com/gotd/td/internal/proto/codec.Full github.com/gotd/td/internal/proto/codec.Intermediate github.com/gotd/td/internal/proto/codec.NoHeader github.com/gotd/td/internal/proto/codec.PaddedIntermediate github.com/gotd/td/internal/proto/codec.TaggedCodec (interface) Codec : github.com/gotd/td/internal/proto/codec.Codec func Protocol.Codec() Codec func Protocol.CodecNoHeader() Codec func github.com/gotd/td/telegram/dcs.Protocol.Codec() Codec
Conn is transport connection. ( Conn) Close() error ( Conn) Recv(ctx context.Context, b *bin.Buffer) error ( Conn) Send(ctx context.Context, b *bin.Buffer) error Conn : io.Closer func Listener.Accept() (_ Conn, rErr error) func Protocol.Handshake(conn net.Conn) (Conn, error) func Protocol.Pipe() (a, b Conn) func github.com/gotd/td/telegram/dcs.Protocol.Handshake(conn net.Conn) (Conn, error) func github.com/gotd/td/telegram/dcs.Resolver.CDN(ctx context.Context, dc int, list dcs.List) (Conn, error) func github.com/gotd/td/telegram/dcs.Resolver.MediaOnly(ctx context.Context, dc int, list dcs.List) (Conn, error) func github.com/gotd/td/telegram/dcs.Resolver.Primary(ctx context.Context, dc int, list dcs.List) (Conn, error) func github.com/gotd/td/internal/exchange.NewExchanger(conn Conn, dc int) exchange.Exchanger
Listener is a simple net.Listener wrapper for listening MTProto transport connections. Accept waits for and returns the next connection to the listener. Addr returns the listener's network address. Close closes the listener. Any blocked Accept operations will be unblocked and return errors. Listener : io.Closer func Listen(listener net.Listener) Listener func ListenCodec(codec func() Codec, listener net.Listener) Listener
Protocol is MTProto transport protocol. See https://core.telegram.org/mtproto/mtproto-transports Codec creates new codec using protocol settings. CodecNoHeader is Codec without header. Handshake inits given net.Conn as MTProto connection. Pipe creates an in-memory MTProto connection. Protocol : github.com/gotd/td/telegram/dcs.Protocol func NewProtocol(getCodec func() Codec) Protocol var Abridged var Full var Intermediate var PaddedIntermediate
Package-Level Functions (total 6, in which 5 are exported)
Listen creates new Listener using given net.Listener. Transport codec will be detected automatically.
ListenCodec creates new Listener using given net.Listener. Listener will always use given Codec constructor.
NewProtocol creates new transport protocol using user Codec constructor. See https://core.telegram.org/mtproto/mtproto-transports
ObfuscatedListener creates new obfuscated2 listener using given net.Listener. Useful for creating Telegram servers: transport.Listen(transport.ObfuscatedListener(ln))
WebsocketListener creates new MTProto Websocket listener.
Package-Level Variables (total 4, all are exported)
Abridged is abridged transport protocol. See https://core.telegram.org/mtproto/mtproto-transports#abridged
Full is full transport protocol. See https://core.telegram.org/mtproto/mtproto-transports#full
Intermediate is intermediate transport protocol. See https://core.telegram.org/mtproto/mtproto-transports#intermediate
PaddedIntermediate is padded intermediate transport protocol. See https://core.telegram.org/mtproto/mtproto-transports#padded-intermediate