github.com/elliott5/community@v0.14.1-0.20160709191136-823126fb026a/documize/api/convert/documizeapi/documizeapi.go (about)

     1  // Copyright 2016 Documize Inc. <legal@documize.com>. All rights reserved.
     2  //
     3  // This software (Documize Community Edition) is licensed under 
     4  // GNU AGPL v3 http://www.gnu.org/licenses/agpl-3.0.en.html
     5  //
     6  // You can operate outside the AGPL restrictions by purchasing
     7  // Documize Enterprise Edition and obtaining a commercial license
     8  // by contacting <sales@documize.com>. 
     9  //
    10  // https://documize.com
    11  
    12  package documizeapi
    13  
    14  import (
    15  	"encoding/json"
    16  
    17  	"github.com/documize/community/wordsmith/api"
    18  
    19  	"golang.org/x/net/context"
    20  )
    21  
    22  // Convert provides the standard interface for conversion of a ".documizeapi" json document.
    23  func Convert(ctx context.Context, in interface{}) (interface{}, error) {
    24  	ret := new(api.DocumentConversionResponse)
    25  	err := json.Unmarshal(in.(*api.DocumentConversionRequest).Filedata, ret)
    26  	return ret, err
    27  }