pdfcombiner

command module
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: 8 Imported by: 0

README

Build Status pdfcombiner

This is an HTTP endpoint that downloads a list of PDFs from Amazon S3, combines and uploads the combined file to S3, and POSTs the job status to a provided callback URL. The format of the request to / should look like:

{
  "bucket_name": "somebucket",
  "doc_list": [
    {
      "key": "s3/path/to/file.pdf",
      "title": "name of pdf"
    },
    {
      "key": "s3/path/to/other/file.pdf",
      "name": "name of pdf"
    }
  ],
  "callback": "http://mycallbackurl.com/combination_result/12345",
  "combined_key": "path/to/upload/combined/file.pdf",
  "title": "Combined Doc for Some Applicant"
}

The server will immediately respond either with:

HTTP/1.1 200 OK
{"response":"ok"}

or

HTTP/1.1 400 Bad Request
{"response":"invalid params"}

When work is complete, the provided callback URL will recieve a POST with a JSON body similar to:

{
  "success": true,
  "errors": {},
  "callback": "http://mycallbackurl.com/combination_result/12345",
  "perf_stats": {
      "606/docs/1068.pdf": {
      "s3/path/to/file.pdf": {
          "Filename": "s3/path/to/file.pdf",
          "Size": 1234,
          "PageCount": 5,
          "DlTime": 622469262
      },
      "s3/path/to/other/file.pdf": {
          "Filename": "s3/path/to/other/file.pdf",
          "Size": 3456,
          "PageCount": 3,
          "DlTime": 622469262
      }
    }
  }
}

"success" is true if at least one file downloaded successfully.

This application requires authentication, please put a file in ~/.pdfcombiner.json with content like:

{"remote_user":"u","remote_password":"pass"}

You can also combine files in standalone mode from the command line. Use ./pdfcombiner -help to get a list of options.

Documentation

Overview

Accept requests to combine PDF documents located on Amazon S3 into a single document, upload back to S3, and notify a callback URL. TODO fail fast if S3 connection is not usable. TODO need a way to enable auth in responses

Directories

Path Synopsis
Godeps
_workspace/src/github.com/PeopleAdmin/gomon
Package gomon adds functionality to aggregate and batch groups of metrics for delivery to AWS Cloudwatch.
Package gomon adds functionality to aggregate and batch groups of metrics for delivery to AWS Cloudwatch.
_workspace/src/github.com/crowdmob/goamz/aws
goamz - Go packages to interact with the Amazon Web Services.
goamz - Go packages to interact with the Amazon Web Services.
Package combiner contains methods to consume Job objects, orchestrating the download, combination, and upload of a group of related PDF files.
Package combiner contains methods to consume Job objects, orchestrating the download, combination, and upload of a group of related PDF files.
Package cpdf contains methods to manipulate pdf files.
Package cpdf contains methods to manipulate pdf files.
Document structs can either point to a url reference where the pdf is stored, or contain a blob of the data itself.
Document structs can either point to a url reference where the pdf is stored, or contain a blob of the data itself.
Package monitoring adds functionality to send metrics to AWS
Package monitoring adds functionality to send metrics to AWS
Package notifier contains types and methods for sending notifications that a job has completed.
Package notifier contains types and methods for sending notifications that a job has completed.
Package server contains handlers which respond to requests to combine pdf files and hands them off to the combiner package.
Package server contains handlers which respond to requests to combine pdf files and hands them off to the combiner package.

Jump to

Keyboard shortcuts

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