change modules
This commit is contained in:
parent
25d603ab8b
commit
38b24058a7
|
@ -1,2 +0,0 @@
|
||||||
github.com/google/uuid v1.6.0 h1:NIvaJDMOsjHA8n1jAhLSgzrAzy1Hgr+hNrb57e+94F0=
|
|
||||||
github.com/google/uuid v1.6.0/go.mod h1:TIyPZe4MgqvfeYDBFedMoGGpEw/LqOeaOT+nhxU+yHo=
|
|
15
cal/main.go
15
cal/main.go
|
@ -4,13 +4,16 @@ import (
|
||||||
"fmt"
|
"fmt"
|
||||||
"os"
|
"os"
|
||||||
"time"
|
"time"
|
||||||
|
|
||||||
|
"go-mod.ewintr.nl/planner/sync/client"
|
||||||
|
"go-mod.ewintr.nl/planner/sync/planner"
|
||||||
)
|
)
|
||||||
|
|
||||||
func main() {
|
func main() {
|
||||||
fmt.Println("cal")
|
fmt.Println("cal")
|
||||||
|
|
||||||
c := NewClient("http://localhost:8092", "testKey")
|
c := client.NewClient("http://localhost:8092", "testKey")
|
||||||
items, err := c.Updated([]Kind{KindEvent}, time.Time{})
|
items, err := c.Updated([]planner.Kind{planner.KindEvent}, time.Time{})
|
||||||
if err != nil {
|
if err != nil {
|
||||||
fmt.Println(err)
|
fmt.Println(err)
|
||||||
os.Exit(1)
|
os.Exit(1)
|
||||||
|
@ -18,18 +21,18 @@ func main() {
|
||||||
|
|
||||||
fmt.Printf("%+v\n", items)
|
fmt.Printf("%+v\n", items)
|
||||||
|
|
||||||
i := Item{
|
i := planner.Item{
|
||||||
ID: "id-1",
|
ID: "id-1",
|
||||||
Kind: KindEvent,
|
Kind: planner.KindEvent,
|
||||||
Updated: time.Now(),
|
Updated: time.Now(),
|
||||||
Body: "body",
|
Body: "body",
|
||||||
}
|
}
|
||||||
if err := c.Update([]Item{i}); err != nil {
|
if err := c.Update([]planner.Item{i}); err != nil {
|
||||||
fmt.Println(err)
|
fmt.Println(err)
|
||||||
os.Exit(1)
|
os.Exit(1)
|
||||||
}
|
}
|
||||||
|
|
||||||
items, err = c.Updated([]Kind{KindEvent}, time.Time{})
|
items, err = c.Updated([]planner.Kind{planner.KindEvent}, time.Time{})
|
||||||
if err != nil {
|
if err != nil {
|
||||||
fmt.Println(err)
|
fmt.Println(err)
|
||||||
os.Exit(1)
|
os.Exit(1)
|
||||||
|
|
|
@ -9,7 +9,7 @@ import (
|
||||||
"strconv"
|
"strconv"
|
||||||
"syscall"
|
"syscall"
|
||||||
|
|
||||||
"go-mod.ewintr.nl/planner/sync/service"
|
"go-mod.ewintr.nl/planner/sync/planner"
|
||||||
)
|
)
|
||||||
|
|
||||||
func main() {
|
func main() {
|
||||||
|
@ -29,7 +29,7 @@ func main() {
|
||||||
os.Exit(1)
|
os.Exit(1)
|
||||||
}
|
}
|
||||||
|
|
||||||
repo, err := service.NewSqlite(dbPath)
|
repo, err := planner.NewSqlite(dbPath)
|
||||||
if err != nil {
|
if err != nil {
|
||||||
fmt.Printf("could not open sqlite db: %s", err.Error())
|
fmt.Printf("could not open sqlite db: %s", err.Error())
|
||||||
os.Exit(1)
|
os.Exit(1)
|
||||||
|
@ -43,7 +43,7 @@ func main() {
|
||||||
})
|
})
|
||||||
|
|
||||||
address := fmt.Sprintf(":%d", port)
|
address := fmt.Sprintf(":%d", port)
|
||||||
srv := service.NewServer(repo, apiKey, logger)
|
srv := planner.NewServer(repo, apiKey, logger)
|
||||||
go http.ListenAndServe(address, srv)
|
go http.ListenAndServe(address, srv)
|
||||||
|
|
||||||
logger.Info("service started")
|
logger.Info("service started")
|
||||||
|
|
|
@ -1,4 +1,4 @@
|
||||||
package service
|
package planner
|
||||||
|
|
||||||
import (
|
import (
|
||||||
"encoding/json"
|
"encoding/json"
|
|
@ -1,4 +1,4 @@
|
||||||
package service
|
package planner
|
||||||
|
|
||||||
import (
|
import (
|
||||||
"bytes"
|
"bytes"
|
|
@ -1,4 +1,4 @@
|
||||||
package service
|
package planner
|
||||||
|
|
||||||
import (
|
import (
|
||||||
"slices"
|
"slices"
|
|
@ -1,4 +1,4 @@
|
||||||
package service
|
package planner
|
||||||
|
|
||||||
import (
|
import (
|
||||||
"testing"
|
"testing"
|
|
@ -1,4 +1,4 @@
|
||||||
package service
|
package planner
|
||||||
|
|
||||||
import (
|
import (
|
||||||
"time"
|
"time"
|
|
@ -1,4 +1,4 @@
|
||||||
package service
|
package planner
|
||||||
|
|
||||||
import (
|
import (
|
||||||
"database/sql"
|
"database/sql"
|
|
@ -1,4 +1,4 @@
|
||||||
package service
|
package planner
|
||||||
|
|
||||||
import (
|
import (
|
||||||
"errors"
|
"errors"
|
Loading…
Reference in New Issue