initial commit

This commit is contained in:
2026-07-11 23:10:14 -04:00
commit db7ad3eec2
8 changed files with 247 additions and 0 deletions
+21
View File
@@ -0,0 +1,21 @@
package api
import (
"encoding/json"
"time"
)
type UnixTimestamp struct {
time.Time
}
func (ut *UnixTimestamp) UnmarshalJSON(b []byte) error {
var timestamp int64
// Unmarshal the raw JSON bytes into an int64
if err := json.Unmarshal(b, &timestamp); err != nil {
return err
}
// Convert the epoch seconds to a time.Time object
ut.Time = time.Unix(timestamp, 0)
return nil
}