package tdesktop
Import Path
github.com/gotd/td/session/tdesktop (on go.dev)
Dependency Relation
imports 21 packages, and imported by one package
Involved Source Files
constant.go
dbi.go
errors.go
file.go
key_data.go
local_key.go
md5.go
mtp_authorization.go
mtp_config.go
mtp_dcoptions.go
Package tdesktop contains Telegram Desktop session decoder.
Package-Level Type Names (total 10, in which 7 are exported)
Account is a Telegram user account representation in Telegram Desktop storage.
Authorization contains Telegram user and MTProto sessions.
Config contains Telegram config.
IDx is an internal Telegram Desktop account ID.
func Read(root string, passcode []byte) ([]Account, error)
func ReadFS(root fs.FS, passcode []byte) ([]Account, error)
func github.com/gotd/td/session.TDesktopSession(account Account) (*session.Data, error)
MTPAuthorization is a Telegram Desktop storage structure which stores MTProto session info.
See https://github.com/telegramdesktop/tdesktop/blob/dev/Telegram/SourceFiles/main/main_account.cpp#L359.
Key is a map of keys per DC ID.
// DC ID -> Key
MainDC is a main DC ID of this user.
UserID is a Telegram user ID.
(*MTPAuthorization) deserialize(r *qtReader) error
func readMTPData(tgf *tdesktopFile, localKey crypto.Key) (MTPAuthorization, error)
MTPConfig is a Telegram Desktop storage structure which stores MTProto config info.
See https://github.com/telegramdesktop/tdesktop/blob/v2.9.8/Telegram/SourceFiles/mtproto/mtproto_config.h.
// default: false
// default: 30000
// default: 10000
// default: 20000
// default: 90000
// default: 1024
// default: 86400 * 7
// default: 200
DCOptions MTPDCOptions
// default: 172800
Environment MTPConfigEnvironment
// default: 100
// default: "https://t.me/"
// default: 10000
// default: 30000
// default: 1500
// default: 5000
// default: 30000
// default: 300000
// default: 1000
// default: 120000
// default: true
// default: 5
// default: 100
// default: false
// default: 172800
// default: 172800
// default: 200
// default: 5
// default: 30
// default: ""
// default: 4
(*MTPConfig) deserialize(r *qtReader) error
func readMTPConfig(tgf *tdesktopFile, localKey crypto.Key) (MTPConfig, error)
func github.com/gotd/td/session.mapConfig(mainDC int, cfg MTPConfig) session.Config
MTPConfigEnvironment is enum of config environment.
String implements fmt.Stringer.
Test denotes that environment is test.
( MTPConfigEnvironment) valid() bool
MTPConfigEnvironment : fmt.Stringer
MTPConfigEnvironment : context.stringer
MTPConfigEnvironment : runtime.stringer
MTPDCOption is a Telegram Desktop storage structure which stores DC info.
See https://github.com/telegramdesktop/tdesktop/blob/v2.9.8/Telegram/SourceFiles/mtproto/mtproto_dc_options.h.
Flags bin.Fields
ID int32
IP string
Port int32
Secret []byte
CDN denotes that this is a CDN DC.
IPv6 denotes that the specified IP is an IPv6 address.
MediaOnly denotes that this DC should only be used to download or upload files.
Static denotes that this IP should be used when connecting through a proxy.
TCPOOnly denotes that this DC only supports connection with transport obfuscation.
(*MTPDCOption) deserialize(r *qtReader, version int32) error
MTPDCOptions is a Telegram Desktop storage structure which stores DCs info.
See https://github.com/telegramdesktop/tdesktop/blob/v2.9.8/Telegram/SourceFiles/mtproto/mtproto_dc_options.cpp#L479.
Options []MTPDCOption
(*MTPDCOptions) deserialize(r *qtReader) error
Package-Level Functions (total 18, in which 2 are exported)
Read reads accounts info from given Telegram Desktop tdata root.
Shorthand for:
ReadFS(os.DirFS(root), passcode)
ReadFS reads Telegram Desktop accounts info from given FS root.
Package-Level Variables (total 3, in which 2 are exported)
ErrKeyInfoDecrypt is returned when key data decrypt fails.
It can happen if passed passcode is wrong.
ErrNoAccounts reports that decoded tdata does not contain any accounts info.
Package-Level Constants (total 78, none are exported)
The pages are generated with Golds v0.6.7. (GOOS=linux GOARCH=amd64) Golds is a Go 101 project developed by Tapir Liu. PR and bug reports are welcome and can be submitted to the issue list. Please follow @Go100and1 (reachable from the left QR code) to get the latest news of Golds. |