From 007e2de369f9fc26da3237646de14f2af5052ee8 Mon Sep 17 00:00:00 2001 From: ewy Date: Fri, 22 May 2026 16:54:49 +0200 Subject: initial commit --- model/run.go | 24 ++++++++++++++++++++++++ 1 file changed, 24 insertions(+) create mode 100644 model/run.go (limited to 'model/run.go') diff --git a/model/run.go b/model/run.go new file mode 100644 index 0000000..9329708 --- /dev/null +++ b/model/run.go @@ -0,0 +1,24 @@ +package model + +import ( + "crypto/md5" + "encoding/hex" + "encoding/json" +) + +type Run struct { + RunSave + RunId string +} + +func NewRun(fileContent []byte) (Run, error) { + var save RunSave + err := json.Unmarshal(fileContent, &save) + sum := md5.Sum(fileContent) + r := Run{RunId: hex.EncodeToString(sum[:]), RunSave: save} + if err != nil { + return r, err + } + + return r, nil +} -- cgit v1.3.1