From 6fe7fe009e24ac868a31f3670df11840542ad5ed Mon Sep 17 00:00:00 2001 From: Erik Winter Date: Wed, 9 Oct 2024 07:26:39 +0200 Subject: [PATCH] wip --- plan/command/sync.go | 10 +++++----- sync/client/memory.go | 22 ++++++++++++++++++++++ 2 files changed, 27 insertions(+), 5 deletions(-) create mode 100644 sync/client/memory.go 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 +}