package pool

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

Dependency Relation
	imports 9 packages, and imported by 2 packages

Involved Source Files options.go Package pool contains Telegram connections pool. pool_conn.go req_map.go session.go
Package-Level Type Names (total 8, in which 5 are exported)
/* sort exporteds by: | */
Conn represents Telegram MTProto connection. ( Conn) Invoke(ctx context.Context, input bin.Encoder, output bin.Decoder) error ( Conn) Ping(ctx context.Context) error ( Conn) Ready() <-chan struct{} ( Conn) Run(ctx context.Context) error *github.com/gotd/td/telegram/internal/manager.Conn Conn : github.com/gotd/td/tg.Invoker
DC represents connection pool to one data center. Close waits while all ongoing requests will be done or until given context is done. Then, closes the DC. Invoke sends MTProto request using one of pool connection. *DC : github.com/gotd/td/telegram.CloseInvoker *DC : github.com/gotd/td/tg.Invoker *DC : io.Closer func NewDC(ctx context.Context, id int, newConn func() Conn, opts DCOptions) *DC
DCOptions is a Telegram data center connections pool options. Logger is instance of zap.Logger. No logs by default. MTProto options for connections. Opened connection limit to the DC. func NewDC(ctx context.Context, id int, newConn func() Conn, opts DCOptions) *DC
Session represents DC session. AuthKey crypto.AuthKey DC int Salt int64 func (*SyncSession).Load() (data Session) func (*SyncSession).Options(opts mtproto.Options) (mtproto.Options, Session) func NewSyncSession(data Session) *SyncSession func (*SyncSession).Store(data Session)
SyncSession is synchronization helper for Session. Load gets session and returns it. Migrate changes current DC and its addr, zeroes AuthKey and Salt. Options fills Key and Salt field of given Options using stored session and returns it. Store saves given Session. func NewSyncSession(data Session) *SyncSession
Package-Level Functions (total 3, in which 2 are exported)
NewDC creates new uninitialized DC.
NewSyncSession creates new SyncSession.
Package-Level Variables (total 2, in which 1 is exported)
ErrConnDead means that connection is closed and can't be used anymore.