snapper

package
v0.0.0-...-2546158 Latest Latest
Warning

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

Go to latest
Published: Aug 28, 2018 License: MIT Imports: 11 Imported by: 0

Documentation

Overview

TODO Communicate with chrome (handle passed in from whatever is running things) to print a PDF given a set of options

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func LaunchChrome

func LaunchChrome(path *string) (*exec.Cmd, error)

func PrintPdfFromHtml

func PrintPdfFromHtml(chromeUrl string, options *Options, html string) ([]byte, error)

TODO: - Need to be able to set options like total timeout, network request timeouts, print args, etc.. - handle context timeout errors (i.e. requests greater than the number set in WithTimeout)

func PrintPdfFromUrl

func PrintPdfFromUrl(chromeUrl string, options *Options, url string) ([]byte, error)

func SetDefaultOptions

func SetDefaultOptions(options *Options)

Types

type Options

type Options struct {
	Timeout *int `json:"timeout"`
}

type Request

type Request struct {
	Html    *string  `json:"html"`
	Url     *string  `json:"url"`
	Options *Options `json:"options"`
}

type Response

type Response struct {
	PdfData string `json:"pdfData"`
}

Jump to

Keyboard shortcuts

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