summaryrefslogtreecommitdiffstats
path: root/afb-client/bower_components/foundation-icon-fonts/svgs/fi-blind.svg
blob: a77a6e79c5c6e8b7b2d18905c7bb6c87
package apiv1

import (
	"net/http"
	"sync"

	"github.com/gin-gonic/gin"
	"github.com/iotbzh/xds-agent/lib/common"
	"github.com/iotbzh/xds-agent/lib/xdsconfig"
)

var confMut sync.Mutex

// GetConfig returns the configuration
func (s *APIService) getConfig(c *gin.Context) {
	confMut.Lock()
	defer confMut.Unlock()

	c.JSON(http.StatusOK, s.cfg)
}

// SetConfig sets 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<
> if err := s.cfg.UpdateAll(cfgArg); err != nil { common.APIError(c, err.Error()) return } c.JSON(http.StatusOK, s.cfg) }