engine

package
v0.2.0 Latest Latest
Warning

This package is not in the latest version of its module.

Go to latest
Published: Oct 15, 2026 License: MIT Imports: 10 Imported by: 0

Documentation

Overview

Package engine provides the core MTProto connection management.

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type Engine

type Engine interface {
	// Connect establishes the connection to Telegram.
	Connect(ctx context.Context) error

	// Disconnect gracefully closes the connection.
	Disconnect() error

	// API returns the high-level MTProto API client.
	API() *tg.Client

	// Raw returns the underlying telegram client.
	Raw() *telegram.Client

	// SetUpdateHandler sets the callback for incoming updates.
	SetUpdateHandler(handler telegram.UpdateHandler)
}

Engine defines the core contract for MTProto network operations.

func NewGotdEngine

func NewGotdEngine(appID int, appHash string, opts telegram.Options) Engine

NewGotdEngine creates a new Engine based on gotd.

Jump to

Keyboard shortcuts

? : This menu
/ : Search site
f or F : Jump to
y or Y : Canonical URL