webhook

package
v0.0.0-...-06eba2f Latest Latest
Warning

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

Go to latest
Published: Oct 26, 2024 License: MIT Imports: 7 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type Server

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

Server represents an HTTP server for handling Telegram webhook updates.

func NewServer

func NewServer(addr string) (srv *Server)

NewServer creates a new instance of Server with the specified address.

func (*Server) Handle

func (srv *Server) Handle(pattern string)

Handle sets up the HTTP handler for the specified pattern to process incoming Telegram updates.

func (*Server) Serve

func (srv *Server) Serve() error

Serve starts the HTTP server and blocks until an error occurs or the server is shut down.

func (*Server) Shutdown

func (srv *Server) Shutdown(ctx context.Context) error

Shutdown gracefully stops the server, allowing active connections to finish.

func (*Server) Updates

func (srv *Server) Updates() tgbotapi.UpdatesChannel

Updates returns the channel for receiving incoming Telegram updates.

Jump to

Keyboard shortcuts

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