rpc

package
v0.4.0 Latest Latest
Warning

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

Go to latest
Published: Jun 14, 2026 License: Apache-2.0 Imports: 28 Imported by: 0

Documentation

Overview

Package rpc implements teled's Telegram RPC handlers over tg.ServerDispatcher.

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type Handler

type Handler struct {
	// contains filtered or unexported fields
}

Handler owns the server dispatcher and backs RPCs with storage.

func New

func New(lg *zap.Logger, database *db.DB, store teled.ObjectStore, dc int, host string, port int, providers obs.Providers) *Handler

New builds a Handler and registers all supported RPCs. database and store may be nil, in which case the corresponding RPCs return an error. providers supplies the OpenTelemetry tracer and meter for this layer.

func (*Handler) OnMessage

func (h *Handler) OnMessage(server *mtproto.Server, req *mtproto.Request) error

OnMessage implements mtproto.Handler: it dispatches the decoded request and sends the result. A *tgerr.Error returned by a handler is converted to an RPC error by the mtproto layer rather than dropping the connection.

Jump to

Keyboard shortcuts

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