server

package
v1.0.0 Latest Latest
Warning

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

Go to latest
Published: Nov 20, 2019 License: MIT Imports: 3 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func NotFoundHandler

func NotFoundHandler() http.Handler

NotFoundHandler returns a 404.

Types

type Application

type Application interface {
	// Send produces a message with fallback.
	Send(topic string, key, data []byte)
	// IsHealthy checks the health of the Application.
	IsHealthy() error
}

Application represents the main application.

type Server

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

Server represents a http server handler.

func New

func New(app Application) *Server

New creates a new Server instance.

func (*Server) HealthHandler

func (s *Server) HealthHandler(w http.ResponseWriter, r *http.Request)

HealthHandler handles health requests.

func (*Server) SendMessageHandler

func (s *Server) SendMessageHandler(w http.ResponseWriter, r *http.Request)

SendMessageHandler handles requests to send a message.

func (*Server) ServeHTTP

func (s *Server) ServeHTTP(w http.ResponseWriter, r *http.Request)

ServeHTTP dispatches the request to the handler whose pattern most closely matches the request URL.

Directories

Path Synopsis

Jump to

Keyboard shortcuts

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