Documentation
¶
Overview ¶
Package tgtest provides test Telegram server for end-to-end test.
Index ¶
- type BufferedConn
- type Handler
- type HandlerFunc
- type Server
- func (s *Server) Addr() net.Addr
- func (s *Server) Close()
- func (s *Server) ForceDisconnect(k Session)
- func (s *Server) Key() *rsa.PublicKey
- func (s *Server) Send(k Session, encoder bin.Encoder) error
- func (s *Server) SendAck(k Session, ids ...int64) error
- func (s *Server) SendConfig(k Session, id int64) error
- func (s *Server) SendPong(k Session, msgID, pingID int64) error
- func (s *Server) SendResult(k Session, id int64, msg bin.Encoder) error
- func (s *Server) SendUpdates(k Session, updates ...tg.UpdateClass) error
- func (s *Server) Serve() error
- func (s *Server) SetHandler(handler Handler)
- func (s *Server) SetHandlerFunc(handler func(s Session, msgID int64, in *bin.Buffer) error)
- func (s *Server) Start()
- type Session
- type Suite
- type TB
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
This section is empty.
Types ¶
type BufferedConn ¶ added in v0.15.1
type BufferedConn struct {
// contains filtered or unexported fields
}
func NewBufferedConn ¶ added in v0.15.1
func NewBufferedConn(conn transport.Conn) *BufferedConn
func (*BufferedConn) Close ¶ added in v0.15.1
func (c *BufferedConn) Close() error
func (*BufferedConn) Push ¶ added in v0.15.1
func (c *BufferedConn) Push(b *bin.Buffer)
type HandlerFunc ¶ added in v0.12.0
HandlerFunc is functional adapter for Handler.OnMessage method.
type Server ¶
type Server struct {
// contains filtered or unexported fields
}
func NewUnstartedServer ¶
func TestTransport ¶ added in v0.12.0
func (*Server) ForceDisconnect ¶ added in v0.12.0
func (*Server) SendResult ¶ added in v0.11.0
func (*Server) SendUpdates ¶ added in v0.12.0
func (s *Server) SendUpdates(k Session, updates ...tg.UpdateClass) error
func (*Server) SetHandler ¶ added in v0.11.0
func (*Server) SetHandlerFunc ¶ added in v0.12.0
type Session ¶ added in v0.11.0
type Session struct { SessionID int64 crypto.AuthKeyWithID }
Click to show internal directories.
Click to hide internal directories.