sync
This commit is contained in:
parent
bdd794a1e7
commit
0f903a5645
|
@ -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
|
||||
}
|
36
plan/main.go
36
plan/main.go
|
@ -44,42 +44,6 @@ func main() {
|
|||
fmt.Println(err)
|
||||
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 {
|
||||
|
|
Loading…
Reference in New Issue