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 ¶
func (c CombinerServer) Ping(w http.ResponseWriter, r *http.Request)
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)