package mtproto

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

Dependency Relation
	imports 27 packages, and imported by 3 packages


Package-Level Type Names (total 11, in which 8 are exported)
/* sort exporteds by: | */
Cipher handles message encryption and decryption. ( Cipher) DecryptFromBuffer(k crypto.AuthKey, buf *bin.Buffer) (*crypto.EncryptedMessageData, error) ( Cipher) Encrypt(key crypto.AuthKey, data crypto.EncryptedMessageData, b *bin.Buffer) error github.com/gotd/td/internal/crypto.Cipher
Conn represents a MTProto client to Telegram. Invoke sends input and decodes result into output. NOTE: Assuming that call contains content message (seqno increment). Ping sends ping request to server and waits until pong is received or context is canceled. Run initializes MTProto connection to server and blocks until disconnection. When connection is ready, Handler.OnSession is called. *Conn : github.com/gotd/td/tg.Invoker func New(dialer Dialer, opt Options) *Conn
Dialer is an abstraction for MTProto transport connection creator. func New(dialer Dialer, opt Options) *Conn func github.com/gotd/td/telegram/internal/manager.CreateConn(create Dialer, mode manager.ConnMode, appID int, opts Options, connOpts manager.ConnOptions) *manager.Conn
Handler will be called on received message from Telegram. ( Handler) OnMessage(b *bin.Buffer) error ( Handler) OnSession(session Session) error *github.com/gotd/td/telegram/internal/manager.Conn
MessageBuf is message id buffer. ( MessageBuf) Consume(id int64) bool *github.com/gotd/td/internal/proto.MessageIDBuf
MessageIDSource is message id generator. ( MessageIDSource) New(t proto.MessageType) int64 *github.com/gotd/td/internal/proto.MessageIDGen
Options of Conn. AckBatchSize is maximum ack-s to buffer. AckInterval is maximum time to buffer ack. Cipher defines message crypto. Clock is current time source. Defaults to system time. CompressThreshold is a threshold in bytes to determine that message is large enough to be compressed using GZIP. If < 0, compression will be disabled. If == 0, default value will be used. DC is datacenter ID for key exchange. Defaults to 2. DialTimeout is timeout of creating connection. ExchangeTimeout is timeout of every key exchange request. Handler will be called on received message. Key that can be used to restore previous connection. Logger is instance of zap.Logger. No logs by default. MaxRetries is max retry count until rpc request failure. MessageID is message id source. Share source between connection to reduce collision probability. PingInterval is duration between ping_delay_disconnect request. PingTimeout sets ping_delay_disconnect timeout. PublicKeys of telegram. If not provided, embedded public keys will be used. Random is random source. Defaults to crypto. RequestTimeout is function which returns request timeout for given type ID. RetryInterval is duration between retries. Salt from server that can be used to restore previous connection. SaltFetchInterval is duration between get_future_salts request. Tracer for OTEL. Types map, used in verbose logging of incoming message. func github.com/gotd/td/internal/pool.(*SyncSession).Options(opts Options) (Options, pool.Session) func New(dialer Dialer, opt Options) *Conn func github.com/gotd/td/internal/pool.(*SyncSession).Options(opts Options) (Options, pool.Session) func github.com/gotd/td/telegram/internal/manager.CreateConn(create Dialer, mode manager.ConnMode, appID int, opts Options, connOpts manager.ConnOptions) *manager.Conn
Session represents connection state. ID int64 Key crypto.AuthKey Salt int64 func Handler.OnSession(session Session) error func github.com/gotd/td/telegram/internal/manager.(*Conn).OnSession(session Session) error func github.com/gotd/td/telegram/internal/manager.Handler.OnSession(cfg tg.Config, s Session) error func github.com/gotd/td/telegram/internal/manager.NoopHandler.OnSession(cfg tg.Config, s Session) error
Package-Level Functions (total 5, in which 1 is exported)
New creates new unstarted connection.
Package-Level Variables (total 4, none are exported)
Package-Level Constants (total 6, none are exported)