This commit is contained in:
Erik Winter 2024-10-07 11:11:18 +02:00
parent bdd794a1e7
commit 0f903a5645
2 changed files with 30 additions and 36 deletions

30
plan/command/sync.go Normal file
View File

@ -0,0 +1,30 @@
package command
import (
"github.com/urfave/cli/v2"
"go-mod.ewintr.nl/planner/plan/storage"
)
var SyncCmd = &cli.Command{
Name: "sync",
Usage: "Synchonize with server",
Flags: []cli.Flag{
&cli.BoolFlag{
Name: "full",
Aliases: []string{"f"},
Usage: "Force full sync",
},
},
}
func NewSyncCmd(localRepo storage.LocalID, eventRepo storage.Event) *cli.Command {
SyncCmd.Action = func(cCtx *cli.Context) error {
return Sync(localRepo, eventRepo, cCtx.Bool("full"))
}
return SyncCmd
}
func Sync(localRepo storage.LocalID, eventRepo storage.Event, full bool) error {
return nil
}

View File

@ -44,42 +44,6 @@ func main() {
fmt.Println(err) fmt.Println(err)
os.Exit(1) os.Exit(1)
} }
// all, err := repo.FindAll()
// if err != nil {
// fmt.Println(err)
// os.Exit(1)
// }
// fmt.Printf("all: %+v\n", all)
// c := client.NewClient("http://localhost:8092", "testKey")
// items, err := c.Updated([]item.Kind{item.KindEvent}, time.Time{})
// if err != nil {
// fmt.Println(err)
// os.Exit(1)
// }
// fmt.Printf("%+v\n", items)
// i := item.Item{
// ID: "id-1",
// Kind: item.KindEvent,
// Updated: time.Now(),
// Body: "body",
// }
// if err := c.Update([]item.Item{i}); err != nil {
// fmt.Println(err)
// os.Exit(1)
// }
// items, err = c.Updated([]item.Kind{item.KindEvent}, time.Time{})
// if err != nil {
// fmt.Println(err)
// os.Exit(1)
// }
// fmt.Printf("%+v\n", items)
} }
type Configuration struct { type Configuration struct {