Documentation ¶
Overview ¶
Package pool contains Telegram connections pool.
Index ¶
Constants ¶
This section is empty.
Variables ¶
View Source
var ErrConnDead = errors.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 ¶
type SyncSession struct {
// contains filtered or unexported fields
}
SyncSession is synchronization helper for Session.
func NewSyncSession ¶
func NewSyncSession(data Session) *SyncSession
NewSyncSession creates new SyncSession.
func (*SyncSession) Load ¶
func (s *SyncSession) Load() (data Session)
Load gets session and returns it.
func (*SyncSession) Migrate ¶
func (s *SyncSession) Migrate(dc int)
Migrate changes current DC and its addr, zeroes AuthKey and Salt.
Click to show internal directories.
Click to hide internal directories.