Source File
device.go
Belonging Package
github.com/gotd/td/telegram/internal/manager
package managerimport ()// DeviceConfig is config which send when Telegram connection session created.type DeviceConfig struct {// Device model.DeviceModel string// Operating 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// Info about an MTProto proxy.Proxy tg.InputClientProxy// Additional initConnection parameters. For now, only the tz_offset field is supported,// for specifying timezone offset in seconds.Params tg.JSONValueClass}// SetDefaults sets default values.func ( *DeviceConfig) () {const = "n/a"// Strings must be non-empty, so set notAvailable if default value is empty.:= func( *string, string) {if != "" {* =} else {* =}}if .DeviceModel == "" {(&.DeviceModel, runtime.Version())}if .SystemVersion == "" {(&.SystemVersion, runtime.GOOS)}if .AppVersion == "" {(&.AppVersion, version.GetVersion())}if .SystemLangCode == "" {.SystemLangCode = "en"}if .LangCode == "" {.LangCode = "en"}// It's okay to use zero value Proxy.// It's okay to use zero value Params.}
![]() |
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. |