This commit is contained in:
Erik Winter 2024-10-09 07:26:39 +02:00
parent 5ab5505d2b
commit 6fe7fe009e
2 changed files with 27 additions and 5 deletions

View File

@ -8,7 +8,7 @@ import (
var SyncCmd = &cli.Command{ var SyncCmd = &cli.Command{
Name: "sync", Name: "sync",
Usage: "Synchonize with server", Usage: "Synchronize with server",
Flags: []cli.Flag{ Flags: []cli.Flag{
&cli.BoolFlag{ &cli.BoolFlag{
Name: "full", Name: "full",
@ -26,6 +26,10 @@ func NewSyncCmd(client *client.Client, localRepo storage.LocalID, eventRepo stor
} }
func Sync(client *client.Client, localRepo storage.LocalID, eventRepo storage.Event, full bool) error { func Sync(client *client.Client, localRepo storage.LocalID, eventRepo storage.Event, full bool) error {
// find local new and updated
// send new and updated
//
// get new/updated items // get new/updated items
// delete deleted // delete deleted
@ -34,9 +38,5 @@ func Sync(client *client.Client, localRepo storage.LocalID, eventRepo storage.Ev
// localid and add new // localid and add new
// find local new and updated
// send new and updated
return nil return nil
} }

22
sync/client/memory.go Normal file
View File

@ -0,0 +1,22 @@
package client
import (
"time"
"go-mod.ewintr.nl/planner/item"
)
type Memory struct {
}
func NewMemory() *Memory {
return &Memory{}
}
func (m *Memory) Update(items []item.Item) error {
return nil
}
func (m *Memory) Updated(kw []item.Kind, ts time.Time) ([]item.Item, error) {
return nil, nil
}