community: Index | Files

package convapi

import ""

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


Package Files

convertapi.go request.go response.go

func SetJSONResponse Uses

func SetJSONResponse(w http.ResponseWriter)

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

func WriteError Uses

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 Uses

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.

type ConversionJobRequest Uses

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 Uses

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 Uses

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 Uses

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

DocumentExport is the type used by a document export plugin.

type EmbeddedFile Uses

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 Uses

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,

Package convapi imports 2 packages (graph) and is imported by 10 packages. Updated 2017-11-01. Refresh now. Tools for package owners.