summaryrefslogtreecommitdiffstats
path: root/lib/apiv1/apiv1.go
diff options
context:
space:
mode:
authorSebastien Douheret <sebastien.douheret@iot.bzh>2017-05-18 11:01:13 +0200
committerSebastien Douheret <sebastien.douheret@iot.bzh>2017-05-18 11:01:13 +0200
commit2c9ae6a5a27ae2f2e23495c613e7a53aed8e786c (patch)
treeb23dbe9051c50a7ed8f666ae71c833fd52823770 /lib/apiv1/apiv1.go
parent51da3506a296b7d5d4185b17364f188292136888 (diff)
Add Cross SDKs support (part 2)
Diffstat (limited to 'lib/apiv1/apiv1.go')
-rw-r--r--lib/apiv1/apiv1.go8
1 files changed, 7 insertions, 1 deletions
diff --git a/lib/apiv1/apiv1.go b/lib/apiv1/apiv1.go
index c94849d..7359266 100644
--- a/lib/apiv1/apiv1.go
+++ b/lib/apiv1/apiv1.go
@@ -4,6 +4,7 @@ import (
"github.com/Sirupsen/logrus"
"github.com/gin-gonic/gin"
+ "github.com/iotbzh/xds-server/lib/crosssdk"
"github.com/iotbzh/xds-server/lib/model"
"github.com/iotbzh/xds-server/lib/session"
"github.com/iotbzh/xds-server/lib/xdsconfig"
@@ -16,17 +17,19 @@ type APIService struct {
sessions *session.Sessions
cfg *xdsconfig.Config
mfolder *model.Folder
+ sdks *crosssdk.SDKs
log *logrus.Logger
}
// New creates a new instance of API service
-func New(sess *session.Sessions, cfg *xdsconfig.Config, mfolder *model.Folder, r *gin.Engine) *APIService {
+func New(r *gin.Engine, sess *session.Sessions, cfg *xdsconfig.Config, mfolder *model.Folder, sdks *crosssdk.SDKs) *APIService {
s := &APIService{
router: r,
sessions: sess,
apiRouter: r.Group("/api/v1"),
cfg: cfg,
mfolder: mfolder,
+ sdks: sdks,
log: cfg.Log,
}
@@ -40,6 +43,9 @@ func New(sess *session.Sessions, cfg *xdsconfig.Config, mfolder *model.Folder, r
s.apiRouter.POST("/folder", s.addFolder)
s.apiRouter.DELETE("/folder/:id", s.delFolder)
+ s.apiRouter.GET("/sdks", s.getSdks)
+ s.apiRouter.GET("/sdk/:id", s.getSdk)
+
s.apiRouter.POST("/make", s.buildMake)
s.apiRouter.POST("/make/:id", s.buildMake)