Documentation
¶
Overview ¶
Package manager contains connection management utilities.
Index ¶
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
This section is empty.
Types ¶
type Conn ¶
type Conn struct {
// contains filtered or unexported fields
}
Conn is a Telegram client connection.
func CreateConn ¶
func CreateConn( id int64, mode ConnMode, appID int, addr string, opts mtproto.Options, connOpts ConnOptions, ) *Conn
CreateConn creates new connection.
type ConnOptions ¶
type ConnOptions struct {
DC int
Device DeviceConfig
Handler Handler
Setup SetupCallback
}
ConnOptions is a Telegram client connection options.
func (*ConnOptions) SetDefaults ¶
func (c *ConnOptions) SetDefaults()
SetDefaults sets default values.
type DeviceConfig ¶
type DeviceConfig struct {
// Device model
DeviceModel string
// Operation system version
SystemVersion string
// Application version
AppVersion string
// Code for the language used on the device's OS, ISO 639-1 standard
SystemLangCode string
// Language pack to use
LangPack string
// Code for the language used on the client, ISO 639-1 standard
LangCode string
}
DeviceConfig is config which send when Telegram connection session created.
func (*DeviceConfig) SetDefaults ¶
func (c *DeviceConfig) SetDefaults()
SetDefaults sets default values.
type Handler ¶
type Handler interface {
OnSession(addr string, cfg tg.Config, s mtproto.Session) error
OnMessage(b *bin.Buffer) error
}
Handler abstracts updates and session handler.
type NoopHandler ¶
type NoopHandler struct{}
NoopHandler is a noop handler.
Click to show internal directories.
Click to hide internal directories.