Documentation ¶
Index ¶
- func SetFilePath(path string)
- func SetLogVerbosityLevel(level int)
- type Client
- func (c *Client) Auth(authorizationState string) (Update, error)
- func (c *Client) Destroy()
- func (c *Client) Execute(jsonQuery interface{}) Update
- func (c *Client) Receive(timeout float64) Update
- func (c *Client) Send(jsonQuery interface{})
- func (c *Client) SendAndCatch(jsonQuery interface{}) (Update, error)
- type Option
- func WithApplicationVersion(version string) Option
- func WithChatInfoDatabase() Option
- func WithDatabaseDir(path string) Option
- func WithDeviceModel(model string) Option
- func WithFileDatabase() Option
- func WithFilesDir(path string) Option
- func WithHash(hash string) Option
- func WithID(id string) Option
- func WithIgnoreFileNames() Option
- func WithMessageDatabase() Option
- func WithPhone(phone string) Option
- func WithSecretChats() Option
- func WithStorageOptimizer() Option
- func WithSystemLanguage(lang string) Option
- func WithSystemVersion(system string) Option
- func WithTestDC() Option
- type Update
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
func SetFilePath ¶
func SetFilePath(path string)
Sets the path to the file to where the internal TDLib log will be written. By default TDLib writes logs to stderr or an OS specific log. Use this method to write the log to a file instead.
func SetLogVerbosityLevel ¶
func SetLogVerbosityLevel(level int)
Sets the verbosity level of the internal logging of TDLib. By default the TDLib uses a verbosity level of 5 for logging.
Types ¶
type Client ¶
type Client struct { Client unsafe.Pointer Updates chan Update // contains filtered or unexported fields }
func NewClient ¶
Creates a new instance of TDLib. Has two public fields: Client itself and Updates channel
func (*Client) Auth ¶
Method for interactive authorizations process, just provide it authorization state from updates and api credentials.
func (*Client) Destroy ¶
func (c *Client) Destroy()
Destroys the TDLib client instance. After this is called the client instance shouldn't be used anymore.
func (*Client) Execute ¶
Synchronously executes TDLib request. Only a few requests can be executed synchronously.
func (*Client) Send ¶
func (c *Client) Send(jsonQuery interface{})
Sends request to the TDLib client. You can provide string or Update.
func (*Client) SendAndCatch ¶
Sends request to the TDLib client and catches the result in updates channel. You can provide string or Update.
type Option ¶
type Option func(*options)
Changes parameters which will be used during execution Auth method with state authorizationStateWaitTdlibParameters.
func WithApplicationVersion ¶
Application version
func WithChatInfoDatabase ¶
func WithChatInfoDatabase() Option
If set to true, the library will maintain a cache of users, basic groups, supergroups, channels and secret chats. Implies use WithFileDatabase()
func WithDatabaseDir ¶
The path to the directory for the persistent database; if empty, the current working directory will be used
func WithDeviceModel ¶
Model of the device the application is being run on
func WithFileDatabase ¶
func WithFileDatabase() Option
If set to true, information about downloaded and uploaded files will be saved between application restarts
func WithFilesDir ¶
The path to the directory for storing files; if empty, database_directory will be used
func WithHash ¶
Application identifier hash for Telegram API access, which can be obtained at https://my.telegram.org
func WithID ¶
Application identifier for Telegram API access, which can be obtained at https://my.telegram.org
func WithIgnoreFileNames ¶
func WithIgnoreFileNames() Option
If set to true, original file names will be ignored. Otherwise, downloaded files will be saved under names as close as possible to the original name
func WithMessageDatabase ¶
func WithMessageDatabase() Option
If set to true, the library will maintain a cache of chats and messages. Implies use WithChatInfoDatabase()
func WithSecretChats ¶
func WithSecretChats() Option
If set to true, support for secret chats will be enabled
func WithStorageOptimizer ¶
func WithStorageOptimizer() Option
If set to true, old files will automatically be deleted
func WithSystemLanguage ¶
IETF language tag of the user's operating system language
func WithSystemVersion ¶
Version of the operating system the application is being run on
func WithTestDC ¶
func WithTestDC() Option
The Telegram test environment will be used instead of the production environment