diff --git a/plan/command/sync.go b/plan/command/sync.go index 886f054..ff4bc46 100644 --- a/plan/command/sync.go +++ b/plan/command/sync.go @@ -8,7 +8,7 @@ import ( var SyncCmd = &cli.Command{ Name: "sync", - Usage: "Synchonize with server", + Usage: "Synchronize with server", Flags: []cli.Flag{ &cli.BoolFlag{ 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 { + // find local new and updated + + // send new and updated + // // get new/updated items // delete deleted @@ -34,9 +38,5 @@ func Sync(client *client.Client, localRepo storage.LocalID, eventRepo storage.Ev // localid and add new - // find local new and updated - - // send new and updated - return nil } diff --git a/sync/client/memory.go b/sync/client/memory.go new file mode 100644 index 0000000..e7190b4 --- /dev/null +++ b/sync/client/memory.go @@ -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 +}