Documentation
¶
Overview ¶
Package pool contains Telegram connections pool.
Index ¶
Constants ¶
This section is empty.
Variables ¶
View Source
var ErrConnDead = xerrors.New("connection dead")
ErrConnDead means that connection is closed and can't be used anymore.
Functions ¶
This section is empty.
Types ¶
type Conn ¶
type Conn interface { Run(ctx context.Context) error Invoke(ctx context.Context, input bin.Encoder, output bin.Decoder) error Ping(ctx context.Context) error Ready() <-chan struct{} }
Conn represents Telegram MTProto connection.
type DC ¶
type DC struct {
// contains filtered or unexported fields
}
DC represents connection pool to one data center.
type DCOptions ¶
type DCOptions struct { // Logger is instance of zap.Logger. No logs by default. Logger *zap.Logger // MTProto options for connections. // Opened connection limit to the DC. MaxOpenConnections int64 }
DCOptions is a Telegram data center connections pool options.
type SyncSession ¶ added in v0.24.0
type SyncSession struct {
// contains filtered or unexported fields
}
SyncSession is synchronization helper for Session.
func NewSyncSession ¶ added in v0.24.0
func NewSyncSession(data Session) *SyncSession
NewSyncSession creates new SyncSession.
func (*SyncSession) Load ¶ added in v0.24.0
func (s *SyncSession) Load() (data Session)
Load gets session and returns it.
func (*SyncSession) Migrate ¶ added in v0.24.0
func (s *SyncSession) Migrate(dc int)
Migrate changes current DC and its addr, zeroes AuthKey and Salt.
func (*SyncSession) Options ¶ added in v0.24.0
Options fills Key and Salt field of given Options using stored session and returns it.
func (*SyncSession) Store ¶ added in v0.24.0
func (s *SyncSession) Store(data Session)
Store saves given Session.
Click to show internal directories.
Click to hide internal directories.