writer

package
v1.0.1 Latest Latest
Warning

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

Go to latest
Published: Jul 9, 2026 License: Apache-2.0 Imports: 12 Imported by: 0

Documentation

Overview

types

Index

Constants

View Source
const (
	NativeProvider    string = "native"
	ContainerProvider string = "container"
	BaseProvider      string = "native"
	WSProvider        string = "webservice"

	PdfEngine     string = "loEngine.odt"
	ZugferdEngine string = "mustang-cli.jar"
	BaseEngine    string = "none"

	BaseKind    WriterKind = "base"
	PdfKind     WriterKind = "pdf"
	ZugferdKind WriterKind = "zugferd"

	PdfExecutable     string = "soffice"
	ZugferdExecutable string = "java"
)
View Source
const (
	FileMask      = 0644
	DirectoryMask = 0755
	PollIntervall = 200 * time.Millisecond
)

Variables

This section is empty.

Functions

func CheckHeartbeat added in v1.0.0

func CheckHeartbeat(heartbeatFile string, timeout time.Duration) (bool, error)

func Check verifies the heartbeat file. It returns 'true' if everything is okay, and 'false', along with an error, if the engine is stuck.

func CopyFile added in v1.0.0

func CopyFile(src, dst string) error

CopyFile: copies a file from src to dst First used in writers, therefore global for writers. In further version should be in a more system global package

Types

type AbstractWriter added in v1.0.0

type AbstractWriter struct {
	Provider   string
	Engine     string
	Executable string
	TimeOut    time.Duration

	JobArtefactsPath string

	JobJsonFile   string
	JobResultFile string
	JobTmpFile    string
}

AbstractWriter is Base-Struct for spezialized writer, should never be instantiated

func (*AbstractWriter) Finalize added in v1.0.0

func (a *AbstractWriter) Finalize(rJob *job.RenderJob, rInput *RenderInput, sourcePath string, lastStep bool) (*RenderOutput, error)

func (*AbstractWriter) Prepare added in v1.0.0

func (a *AbstractWriter) Prepare(rJob *job.RenderJob, rInput *RenderInput) error

func (*AbstractWriter) WriteJob added in v1.0.0

func (a *AbstractWriter) WriteJob(rJob *job.RenderJob) error

type RenderInput

type RenderInput struct {
	Provider      string
	BytesToRender []byte
	ParPath       string
	OttPath       string
	PdfPath       string
	XMLPath       string
	ArtefactsPath string
	RootPath      string
	Attachments   []string
	OutputPath    string
}

type RenderOutput

type RenderOutput struct {
	JobID      string
	OutputPath string
	ParPath    string
	StatusPath string
	ODTPath    string
	FXPath     string
	PDFPath    string
}

type Writer

type Writer interface {
	Render(ctx context.Context, rJob *job.RenderJob, rInput *RenderInput, finalize bool) (*RenderOutput, error)
	Prepare(job *job.RenderJob, input *RenderInput) error
	Finalize(rJob *job.RenderJob, rInput *RenderInput, sourcePath string, lastStep bool) (*RenderOutput, error)
}

type WriterKind added in v1.0.0

type WriterKind string

Working Env Definition

Jump to

Keyboard shortcuts

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