Some work

This commit is contained in:
2024-04-08 23:23:23 +02:00
parent 01e96380a4
commit c60dd3357f
15 changed files with 407 additions and 23 deletions

7
model/timer.go Normal file
View File

@ -0,0 +1,7 @@
package model
type Timer struct {
Id UUID
Name string
}

28
model/uuid.go Normal file
View File

@ -0,0 +1,28 @@
package model
import (
sqldriver "database/sql/driver"
"github.com/google/uuid"
)
type UUID struct {
payload uuid.UUID
}
func NewUUID() UUID {
id, _ := uuid.NewRandom()
return UUID { payload: id }
}
func (self UUID) Value() (sqldriver.Value, error) {
return self.payload.MarshalBinary()
}
func (self *UUID) Scan(value any) error {
return self.payload.Scan(value)
}
func (self UUID) String() string {
return self.payload.String()
}