Skip to content

Commit 733ec58

Browse files
committed
Move API into nextmn/json-api
1 parent 9c21e87 commit 733ec58

File tree

8 files changed

+7
-106
lines changed

8 files changed

+7
-106
lines changed

go.mod

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -7,6 +7,7 @@ require (
77
github.com/gin-gonic/gin v1.9.1 // indirect
88
github.com/gofrs/uuid v4.4.0+incompatible // indirect
99
github.com/louisroyer/go-pfcp-networking v0.0.24-0.20230113122010-1b98989277a2
10+
github.com/nextmn/json-api v0.0.2 // indirect
1011
github.com/twinj/uuid v1.0.0 // indirect
1112
github.com/urfave/cli/v2 v2.3.0
1213
gopkg.in/yaml.v3 v3.0.1

go.sum

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -48,6 +48,8 @@ github.com/modern-go/concurrent v0.0.0-20180306012644-bacd9c7ef1dd h1:TRLaZ9cD/w
4848
github.com/modern-go/concurrent v0.0.0-20180306012644-bacd9c7ef1dd/go.mod h1:6dJC0mAP4ikYIbvyc7fijjWJddQyLn8Ig3JB5CqoB9Q=
4949
github.com/modern-go/reflect2 v1.0.2 h1:xBagoLtFs94CBntxluKeaWgTMpvLxC4ur3nMaC9Gz0M=
5050
github.com/modern-go/reflect2 v1.0.2/go.mod h1:yWuevngMOJpCy52FWWMvUC8ws7m/LJsjYzDa0/r8luk=
51+
github.com/nextmn/json-api v0.0.2 h1:Xo18bv+eWPc+BBfjNP5MdA0bWokaupzEGW5kt1BwYxg=
52+
github.com/nextmn/json-api v0.0.2/go.mod h1:gi9IhsD+FFg7iEnJaZtEaY1WlZkQ75KBBk0z5FmSJBU=
5153
github.com/pascaldekloe/goe v0.1.0 h1:cBOtyMzM9HTpWjXfbbunk26uA6nG3a8n06Wieeh0MwY=
5254
github.com/pascaldekloe/goe v0.1.0/go.mod h1:lzWF7FIEvWOWxwDKqyGYQf6ZUaNfKdP144TG7ZOy1lc=
5355
github.com/pelletier/go-toml/v2 v2.0.8 h1:0ctb6s9mE31h0/lhu+J6OPmVeDxJn+kYnJc2jZR9tGQ=

json_api/backbone_ip.go

Lines changed: 0 additions & 24 deletions
This file was deleted.

json_api/control_url.go

Lines changed: 0 additions & 30 deletions
This file was deleted.

json_api/locator.go

Lines changed: 0 additions & 28 deletions
This file was deleted.

json_api/router.go

Lines changed: 0 additions & 11 deletions
This file was deleted.

json_api/router_map.go

Lines changed: 0 additions & 9 deletions
This file was deleted.

runtime/http.go

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -14,7 +14,7 @@ import (
1414

1515
"github.com/gin-gonic/gin"
1616
"github.com/gofrs/uuid"
17-
"github.com/nextmn/srv6-ctrl/json_api"
17+
"github.com/nextmn/json-api/jsonapi"
1818
)
1919

2020
type HttpServerEntity struct {
@@ -24,12 +24,12 @@ type HttpServerEntity struct {
2424

2525
type RouterRegistry struct {
2626
sync.RWMutex
27-
routers json_api.RouterMap
27+
routers jsonapi.RouterMap
2828
}
2929

3030
func NewHttpServerEntity(addr string, port string) *HttpServerEntity {
3131
rr := RouterRegistry{
32-
routers: make(json_api.RouterMap),
32+
routers: make(jsonapi.RouterMap),
3333
}
3434
r := gin.Default()
3535
r.GET("/status", rr.Status)
@@ -91,7 +91,7 @@ func (r *RouterRegistry) GetRouter(c *gin.Context) {
9191

9292
// post a router infos
9393
func (r *RouterRegistry) PostRouter(c *gin.Context) {
94-
var router json_api.Router
94+
var router jsonapi.Router
9595
if err := c.BindJSON(&router); err != nil {
9696
c.JSON(http.StatusBadRequest, gin.H{"message": "could not deserialize", "error": fmt.Sprintf("%v", err)})
9797
return

0 commit comments

Comments
 (0)