From 2f7828d01f4c4ca2909f95f098627cd5475ed225 Mon Sep 17 00:00:00 2001 From: Sebastien Douheret Date: Wed, 29 Nov 2017 08:54:00 +0100 Subject: Refit source files to have a public xs-apiv1 lib package. Signed-off-by: Sebastien Douheret --- lib/apiv1/config.go | 40 ---------------------------------------- 1 file changed, 40 deletions(-) delete mode 100644 lib/apiv1/config.go (limited to 'lib/apiv1/config.go') diff --git a/lib/apiv1/config.go b/lib/apiv1/config.go deleted file mode 100644 index 4b53217..0000000 --- a/lib/apiv1/config.go +++ /dev/null @@ -1,40 +0,0 @@ -package apiv1 - -import ( - "net/http" - "sync" - - "github.com/gin-gonic/gin" - common "github.com/iotbzh/xds-common/golib" - "github.com/iotbzh/xds-server/lib/xdsconfig" -) - -var confMut sync.Mutex - -// GetConfig returns server configuration -func (s *APIService) getConfig(c *gin.Context) { - confMut.Lock() - defer confMut.Unlock() - - c.JSON(http.StatusOK, s.cfg) -} - -// SetConfig sets server configuration -func (s *APIService) setConfig(c *gin.Context) { - // FIXME - must be tested - c.JSON(http.StatusNotImplemented, "Not implemented") - - var cfgArg xdsconfig.Config - - if c.BindJSON(&cfgArg) != nil { - common.APIError(c, "Invalid arguments") - return - } - - confMut.Lock() - defer confMut.Unlock() - - s.log.Debugln("SET config: ", cfgArg) - - common.APIError(c, "Not Supported") -} -- cgit 1.2.3-korg