Documentation
¶
Index ¶
- Constants
- func CheckHeartbeat(heartbeatFile string, timeout time.Duration) (bool, error)
- func CopyFile(src, dst string) error
- func Register(kind WriterKind, factory FactoryFunc)
- type AbstractWriter
- type FactoryFunc
- type JobRPCResponse
- type OutputFileType
- type RenderInput
- type RenderOutput
- type Writer
- type WriterKind
Constants ¶
View Source
const ( NativeProvider string = "native" ContainerProvider string = "container" BaseProvider string = "native" 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 Check verifies the heartbeat file. It returns 'true' if everything is okay, and 'false', along with an error, if the engine is stuck.
func Register ¶
func Register(kind WriterKind, factory FactoryFunc)
Register is called by the engines to sign up.
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
type FactoryFunc ¶
type FactoryFunc func(provider string, engine string, timeout time.Duration, heartbeat time.Duration) (Writer, error)
Registry for writers: The shared blueprint for all factory functions
type JobRPCResponse ¶ added in v0.2.0
type JobRPCResponse struct {
JobID string `json:"job_id"`
OutputFile OutputFileType `json:"output_file"` // Hauptergebnis (PDF, XML, etc.)
Attachments []OutputFileType `json:"attachments,omitempty"` // Optionale Zusatzdokumente/Belege
}
JobRPCResponse bildet das Gesamtergebnis des Jobs ab.
type OutputFileType ¶ added in v0.2.0
type OutputFileType struct {
Name string `json:"name"` // "factur-x.xml", "rechnung.pdf", ...
MimeType string `json:"mime_type"` // "application/pdf", "text/xml", ...
Size int64 `json:"size"` // Filesize in Bytes
// Entweder Direct Payload (für normale/kleine Dateien)...
Data []byte `json:"data,omitempty"` // Wird im JSON automatisch Base64-kodiert
// ...oder Referenz für große Dateien (wird später genutzt)
URL string `json:"url,omitempty"` // Download-URL oder Pfad
}
---------------------------- OutputFileType beschreibt eine generierte Datei oder einen Anhang.
type RenderInput ¶
type RenderOutput ¶
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)
}
Click to show internal directories.
Click to hide internal directories.