store

package
v0.42.0 Latest Latest
Warning

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

Go to latest
Published: Feb 22, 2017 License: AGPL-3.0 Imports: 10 Imported by: 0

Documentation

Overview

Package store provides the implementation for a file system based storage provider. This enables all document upload previews to be processed AND stored locally.

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func ConvertFileResult

func ConvertFileResult(filename string, fileResult *api.DocumentConversionResponse) (document entity.Document)

ConvertFileResult takes the results of a document upload and convert, and creates the outline of a database record suitable for inserting into the document table.

func ExportAs

func ExportAs(xtn, html string) (*api.DocumentExport, error)

ExportAs takes a target extension name and html to create an exported file. If the target extension is "html" it simply returns the given html suitably wrapped, otherwise it runs the "Export" plugin for the given target extension name.

Types

type LocalStorageProvider

type LocalStorageProvider struct {
}

LocalStorageProvider provides an implementation of StorageProvider.

func (*LocalStorageProvider) Convert

func (store *LocalStorageProvider) Convert(params api.ConversionJobRequest) (filename string, fileResult *api.DocumentConversionResponse, err error)

Convert a file from its native format into Documize internal format.

func (*LocalStorageProvider) Upload

func (store *LocalStorageProvider) Upload(job string, filename string, file []byte) (err error)

Upload a flie and store it locally.

type StorageProvider

type StorageProvider interface {
	Upload(job string, filename string, file []byte) (err error)
	Convert(api.ConversionJobRequest) (filename string, fileResult *api.DocumentConversionResponse, err error)
}

StorageProvider describes the interface for document conversion and take-on.

Jump to

Keyboard shortcuts

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