Code Review
/
src
/
xds
/
xds-server.git
/ blobdiff
commit
grep
author
committer
pickaxe
?
search:
re
summary
|
shortlog
|
log
|
commit
|
commitdiff
|
review
|
tree
raw
|
inline
| side by side
Refit source files to have a public xs-apiv1 lib package.
[src/xds/xds-server.git]
/
lib
/
xdsserver
/
apiv1-config.go
diff --git
a/lib/apiv1/config.go
b/lib/xdsserver/apiv1-config.go
similarity index 78%
rename from
lib/apiv1/config.go
rename to
lib/xdsserver/apiv1-config.go
index
4b53217
..
5a5bb6e
100644
(file)
--- a/
lib/apiv1/config.go
+++ b/
lib/xdsserver/apiv1-config.go
@@
-1,4
+1,4
@@
-package
apiv1
+package
xdsserver
import (
"net/http"
import (
"net/http"
@@
-6,7
+6,7
@@
import (
"github.com/gin-gonic/gin"
common "github.com/iotbzh/xds-common/golib"
"github.com/gin-gonic/gin"
common "github.com/iotbzh/xds-common/golib"
- "github.com/iotbzh/xds-server/lib/x
dsconfig
"
+ "github.com/iotbzh/xds-server/lib/x
sapiv1
"
)
var confMut sync.Mutex
)
var confMut sync.Mutex
@@
-16,7
+16,7
@@
func (s *APIService) getConfig(c *gin.Context) {
confMut.Lock()
defer confMut.Unlock()
confMut.Lock()
defer confMut.Unlock()
- c.JSON(http.StatusOK, s.
cf
g)
+ c.JSON(http.StatusOK, s.
Confi
g)
}
// SetConfig sets server configuration
}
// SetConfig sets server configuration
@@
-24,7
+24,7
@@
func (s *APIService) setConfig(c *gin.Context) {
// FIXME - must be tested
c.JSON(http.StatusNotImplemented, "Not implemented")
// FIXME - must be tested
c.JSON(http.StatusNotImplemented, "Not implemented")
- var cfgArg x
dsconfig.
Config
+ var cfgArg x
sapiv1.API
Config
if c.BindJSON(&cfgArg) != nil {
common.APIError(c, "Invalid arguments")
if c.BindJSON(&cfgArg) != nil {
common.APIError(c, "Invalid arguments")
@@
-34,7
+34,7
@@
func (s *APIService) setConfig(c *gin.Context) {
confMut.Lock()
defer confMut.Unlock()
confMut.Lock()
defer confMut.Unlock()
- s.
l
og.Debugln("SET config: ", cfgArg)
+ s.
L
og.Debugln("SET config: ", cfgArg)
common.APIError(c, "Not Supported")
}
common.APIError(c, "Not Supported")
}