minor changes

This commit is contained in:
Maximilian Wagner
2025-12-27 22:52:04 +01:00
parent b65ed45477
commit 2c05415ed1
7 changed files with 160 additions and 42 deletions

View File

@@ -38,6 +38,35 @@ type LatexExecution struct {
Output []byte
}
var LatexExec LatexExecution
var LatexExecutionStateSuccess = "Success"
var LatexExecutionStateFailure = "Failure"
// Creates a copy of a LatexExecution (without the Mutex)
func (execution *LatexExecution) Copy() (exeCopy *LatexExecution) {
if execution == nil { return nil }
exeCopy = &LatexExecution{
ExecutionState: execution.ExecutionState,
Timestamp: execution.Timestamp,
TimestampRFC: execution.TimestampRFC,
}
if execution.Output != nil {
exeCopy.Output = make([]byte, len(execution.Output))
copy(exeCopy.Output, execution.Output)
}
return exeCopy
}
// Returns whether the two executions are equal
func (left *LatexExecution) Equal(right *LatexExecution) (isEqual bool) {
if left.ExecutionState != right.ExecutionState { return false }
if left.Timestamp != right.Timestamp { return false }
if left.TimestampRFC != right.TimestampRFC { return false }
if string(left.Output) != string(right.Output) { return false }
return true
}
type ClientInfo struct {
ClientIP string