docustream

package module
v0.0.6 Latest Latest
Warning

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

Go to latest
Published: Aug 31, 2024 License: MIT Imports: 9 Imported by: 0

README

DocuStream Go Client

The DocuStream Go Client provides an interface for interacting with the DocuStream service, allowing you to apply word formats from templates and convert Word files to PDF.

Features

1. Apply Word Formats from a Template: ApplyWord
  • Description: Applies specific word formats to documents using a pre-defined template.
  • Prerequisites: The DocuStream service must be running. Refer to the DocuStream repository for setup instructions.
  • Client Setup: Use NewWordClient to create a client that connects to the DocuStream service.
2. Convert Word Files to PDF: WordToPDF
  • Description: Converts Word documents to PDF format.
  • Prerequisites: Ensure the DocuStream service for conversion is running. See the service setup instructions for details.
  • Client Setup: Use NewConvertClient to create a client for handling conversion tasks.

Usage

  • For detailed usage, refer to the test cases provided in the repository, which demonstrate the use of ApplyWord and WordToPDF functions.

Additional Information

  • Dependencies: Ensure all dependencies are installed and services are correctly configured.
  • Setup: Refer to the DocuStream repository README for complete setup instructions.

Support

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type ConnectOptions

type ConnectOptions struct {
	Url string
}

type Convert added in v0.0.6

type Convert struct {
	// contains filtered or unexported fields
}

func NewConvertClient added in v0.0.6

func NewConvertClient(c *ConnectOptions) (*Convert, error)

func (*Convert) WordToPdf added in v0.0.6

func (c *Convert) WordToPdf(docu *[]byte) (*[]byte, error)

TODO: Refactor send and recv for any new grpc service

type DocuValue added in v0.0.5

type DocuValue struct {
	Type  DocuValueType
	Key   string
	Value DocuValueRaw
}

type DocuValueRaw added in v0.0.5

type DocuValueRaw = interface{}

type DocuValueType added in v0.0.5

type DocuValueType pb.DocuValueType
const DocuValueTypeImage DocuValueType = 1
const DocuValueTypeText DocuValueType = 0

type Word

type Word struct {
	// contains filtered or unexported fields
}

func NewWordClient

func NewWordClient(c *ConnectOptions) (*Word, error)

func (*Word) Apply

func (w *Word) Apply(req *WordApplyReq) (*WordApplyRes, error)

type WordApplyReq

type WordApplyReq struct {
	Docu   []byte
	Body   []DocuValue
	Header []DocuValue
	Footer []DocuValue
}

type WordApplyRes

type WordApplyRes struct {
	Docu []byte
}

Directories

Path Synopsis

Jump to

Keyboard shortcuts

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