func (s *Server) Run(chi *chi.Mux, port string) {
	go func() {
		for message := range s.queue.Channel() {
			go s.handlers[message.Topic].Handle(message.Payload)
		}
	}()
	for _, watcher := range s.watchers {
		go watcher.Watch(s.queue)
	}
	s.logger.Infof("Listening on port [%s]", port)
	s.logger.Fatal(http.ListenAndServe(port, chi))
}
Run starts every handler and watcher, serving the chi.Mux on a given port
package server
import (
	"github.com/go-chi/chi"
	q "github.com/limechain/hedera-eth-bridge-validator/app/core/queue"
	"github.com/limechain/hedera-eth-bridge-validator/app/domain/queue"
	"github.com/limechain/hedera-eth-bridge-validator/config"
	log "github.com/sirupsen/logrus"
	"net/http"
)
type Watcher interface {
	Watch(queue queue.Queue)
}
type Handler interface {
	Handle(interface{})
}
type Server struct {
	logger   *log.Entry
	watchers []Watcher
	handlers map[string]Handler
	queue    queue.Queue
}
func NewServer() *Server {
	return &Server{
		logger:   config.GetLoggerFor("Server"),
		handlers: make(map[string]Handler),
		queue:    q.NewQueue(),
	}
}
func (s *Server) AddWatcher(watcher Watcher) {
	s.watchers = append(s.watchers, watcher)
}
func (s *Server) AddHandler(topic string, handler Handler) {
	s.handlers[topic] = handler
}