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.
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.