planner/cal/planner.go

36 lines
529 B
Go
Raw Normal View History

2024-09-18 07:55:14 +02:00
package main
2024-09-11 07:50:27 +02:00
import (
"time"
"github.com/google/uuid"
)
type Kind string
const (
KindTask Kind = "task"
KindEvent Kind = "event"
)
var (
KnownKinds = []Kind{KindTask, KindEvent}
)
type Item struct {
ID string `json:"id"`
Kind Kind `json:"kind"`
Updated time.Time `json:"updated"`
Deleted bool `json:"deleted"`
Body string `json:"body"`
}
func NewItem(k Kind, body string) Item {
return Item{
ID: uuid.New().String(),
Kind: k,
Updated: time.Now(),
Body: body,
}
}