Documentation
¶
Overview ¶
Package messages contains a personal-messages service implementation for the tgtest server.
It implements a minimal subset of the messages.* API needed to exercise 1:1 (user-to-user) messaging end-to-end against the in-process tgtest server: sending messages (messages.sendMessage), reading them back (messages.getHistory) and delivering them to connected recipients as tg.UpdateNewMessage updates.
Only user peers (tg.InputPeerSelf and tg.InputPeerUser) are supported; chats and channels are intentionally out of scope.
Index ¶
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
This section is empty.
Types ¶
type Option ¶
type Option func(*Service)
Option configures Service.
type Service ¶
type Service struct {
// contains filtered or unexported fields
}
Service is a Telegram personal-messages service.
It is safe for concurrent use.
func (*Service) AddUser ¶
AddUser registers user in the service registry and returns it.
Registered users are resolved by ID when an InputPeerUser refers to them and are included in the Users field of responses and updates.
func (*Service) Register ¶
func (s *Service) Register(d *tgtest.Dispatcher)
Register registers service handlers in the dispatcher.