server

package
v1.0.0 Latest Latest
Warning

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

Go to latest
Published: Dec 12, 2017 License: MIT Imports: 8 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 {
	// Get the next message from the queue.
	GetNextMessage(ctx context.Context, topic string) ([]byte, error)
	// GetNextBatch gets the next count messages from the queue.
	GetNextBatch(ctx context.Context, topic string, count int) ([][]byte, error)
	// 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) BatchTopicHandler added in v1.0.0

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

TopicHandler handles requests to for messages.

func (*Server) HealthHandler

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

HealthHandler handles health requests.

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.

func (*Server) TopicHandler

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

TopicHandler handles requests to for messages.

Directories

Path Synopsis

Jump to

Keyboard shortcuts

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