server

package
v0.0.0-...-a305310 Latest Latest
Warning

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

Go to latest
Published: May 24, 2023 License: MIT Imports: 13 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 {
	http.Server
	metrics.Metrics
	rmqproducer.Publisher
	// contains filtered or unexported fields
}

func NewServer

func NewServer(addr string, metrics metrics.Metrics, publisher rmqproducer.Publisher) *Server

Create a new server which is composed of an HTTP server and a RabbitMQ publisher

func (*Server) PublishToRmq

func (s *Server) PublishToRmq(payload interface{}) error

Publish a message out to the RabbitMQ exchange

func (*Server) Start

func (s *Server) Start() error

Start the server and start metrics on a new goroutine

func (*Server) Stop

func (s *Server) Stop()

Stop the server and stop the ticker

Jump to

Keyboard shortcuts

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