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/xdsconfig/config.go | 23 +++++++++++------------ 1 file changed, 11 insertions(+), 12 deletions(-) (limited to 'lib/xdsconfig/config.go') diff --git a/lib/xdsconfig/config.go b/lib/xdsconfig/config.go index 0fc1346..0201d40 100644 --- a/lib/xdsconfig/config.go +++ b/lib/xdsconfig/config.go @@ -9,16 +9,13 @@ import ( "github.com/Sirupsen/logrus" "github.com/codegangsta/cli" common "github.com/iotbzh/xds-common/golib" + "github.com/iotbzh/xds-server/lib/xsapiv1" ) // Config parameters (json format) of /config command type Config struct { - ServerUID string `json:"id"` - Version string `json:"version"` - APIVersion string `json:"apiVersion"` - VersionGitTag string `json:"gitTag"` - SupportedSharing map[string]bool `json:"supportedSharing"` - Builder BuilderConfig `json:"builder"` + // Public APIConfig fields + xsapiv1.APIConfig // Private (un-exported fields in REST GET /config route) Options Options `json:"-"` @@ -64,12 +61,14 @@ func Init(cliCtx *cli.Context, log *logrus.Logger) (*Config, error) { // Define default configuration c := Config{ - ServerUID: uuid, - Version: cliCtx.App.Metadata["version"].(string), - APIVersion: DefaultAPIVersion, - VersionGitTag: cliCtx.App.Metadata["git-tag"].(string), - Builder: BuilderConfig{}, - SupportedSharing: map[string]bool{ /*FIXME USE folder.TypePathMap*/ "PathMap": true}, + APIConfig: xsapiv1.APIConfig{ + ServerUID: uuid, + Version: cliCtx.App.Metadata["version"].(string), + APIVersion: DefaultAPIVersion, + VersionGitTag: cliCtx.App.Metadata["git-tag"].(string), + Builder: xsapiv1.BuilderConfig{}, + SupportedSharing: map[string]bool{ /*FIXME USE folder.TypePathMap*/ "PathMap": true}, + }, Options: Options{ ConfigFile: cliCtx.GlobalString("config"), -- cgit 1.2.3-korg