39 lines
747 B
Go
39 lines
747 B
Go
package main
|
|
|
|
import "go-mod.ewintr.nl/planner/item"
|
|
|
|
// 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,
|
|
// }
|
|
// }
|
|
|
|
type EventRepo interface {
|
|
Store(event item.Event) error
|
|
Find(id string) (item.Event, error)
|
|
FindAll() ([]item.Event, error)
|
|
Delete(id string) error
|
|
}
|