writer

package
v0.0.0-...-1e0b7ec Latest Latest
Warning

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

Go to latest
Published: Jul 12, 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

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

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

func Register

func Register(kind WriterKind, factory FactoryFunc)

Register wird von den Engines aufgerufen, um sich anzumelden

Types

type AbstractWriter

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

	JobArtefactsPath string

	JobJsonFile   string
	JobResultFile string
	JobTmpFile    string
}

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

func (*AbstractWriter) Finalize

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

func (*AbstractWriter) Prepare

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

func (*AbstractWriter) WriteJob

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

type FactoryFunc

type FactoryFunc func(provider string, engine string, timeout time.Duration, heartbeat time.Duration) (Writer, error)

Registry for writers: Der gemeinsame Bauplan für alle Factory-Funktionen

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)
}

func CreateWriter

func CreateWriter(kind WriterKind, provider string, engine string, timeout time.Duration, heartbeat time.Duration) (Writer, error)

CreateWriter ist nun die universelle Factory, die der Orchestrator aufruft

type WriterKind

type WriterKind string

Working Env Definition

Jump to

Keyboard shortcuts

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