server

package
v0.0.0-...-dfcb032 Latest Latest
Warning

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

Go to latest
Published: Oct 7, 2014 License: MIT Imports: 15 Imported by: 0

Documentation

Overview

Package server contains handlers which respond to requests to combine pdf files and hands them off to the combiner package. TODO more informative validation errors

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type CombinerServer

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

A CombinerServer needs a port to listen on and a WaitGroup to keep track of how many background jobs it has spawned that have not yet yet completed their work.

func (CombinerServer) Listen

func (c CombinerServer) Listen(listenPort int)

Listen starts a HTTP server listening on `Port` to respond to JSON-formatted combination requests.

func (CombinerServer) Ping

Ping is no-op handler for responding to things like health checks. It responds 200 OK with no content to all requests.

func (CombinerServer) ProcessJob

func (c CombinerServer) ProcessJob(w http.ResponseWriter, r *http.Request)

ProcessJob is a handler to recieve a JSON body encoding a Job. If it validates, send it along to be fulfilled, keeping track of the in-flight job count.

func (CombinerServer) Status

func (c CombinerServer) Status(w http.ResponseWriter, r *http.Request)

Jump to

Keyboard shortcuts

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