convapi

package
v2.4.0+incompatible Latest Latest
Warning

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

Go to latest
Published: Apr 19, 2019 License: AGPL-3.0 Imports: 2 Imported by: 0

Documentation

Overview

Package convapi provides the definitions of types used for file conversion communication between different components of the Documize system.

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func SetJSONResponse

func SetJSONResponse(w http.ResponseWriter)

SetJSONResponse sets the response type to "application/json" in the HTTP header.

func WriteError

func WriteError(w http.ResponseWriter, err error)

WriteError to the http.ResponseWriter, taking care to provide the correct response error code within the JSON response.

func WriteErrorBadRequest

func WriteErrorBadRequest(w http.ResponseWriter, message string)

WriteErrorBadRequest provides feedback to a Documize client on an error, where that error is described in a string.

Types

type ConversionJobRequest

type ConversionJobRequest struct {
	Job              string
	IndexDepth       uint
	OrgID            string
	LicenseKey       []byte
	LicenseSignature []byte
	ServiceEndpoint  string
}

ConversionJobRequest is the information used to set-up a conversion job.

type DocumentConversionRequest

type DocumentConversionRequest struct {
	Filename         string
	Filedata         []byte
	PageBreakLevel   uint
	LicenseKey       []byte
	LicenseSignature []byte
	ServiceEndpoint  string
}

DocumentConversionRequest is what is passed to a Convert plugin.

type DocumentConversionResponse

type DocumentConversionResponse struct {
	Err           string
	PagesHTML     []byte // If empty, use Pages
	Pages         []Page
	EmbeddedFiles []EmbeddedFile
	Excerpt       string
}

DocumentConversionResponse is the response from a Convert plugin.

type DocumentExport

type DocumentExport struct {
	Filename string
	Format   string
	File     []byte
}

DocumentExport is the type used by a document export plugin.

type EmbeddedFile

type EmbeddedFile struct {
	ID, Type, Name string // name must have the same extension as the type e.g. Type="txt" Name="foo.txt"
	Data           []byte
}

EmbeddedFile holds the contents of an embedded file.

type Page

type Page struct {
	Level uint64 // overall document is level 1, <H1> => level 2
	Title string
	Body  []byte
}

Page holds the contents of a Documize page, which is a Body of html with a Title and a Level,

Jump to

Keyboard shortcuts

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