minor changes
This commit is contained in:
@@ -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
|
||||
|
||||
Reference in New Issue
Block a user