X-Git-Url: https://gerrit.automotivelinux.org/gerrit/gitweb?a=blobdiff_plain;f=utils.go;h=f70d5da1f5ae651fddf2613b50f063d5cb403a7a;hb=f95aa5f0e39b85198655e8399c161fc5e6cd8a59;hp=6a05ef3e01547dc72d532545c6861f0e117af4e7;hpb=c35d7a0fc8bbb1f9123bb41a7b66e45ea2564dd2;p=src%2Fxds%2Fxds-cli.git diff --git a/utils.go b/utils.go index 6a05ef3..f70d5da 100644 --- a/utils.go +++ b/utils.go @@ -1,23 +1,41 @@ +/* + * Copyright (C) 2017 "IoT.bzh" + * Author Sebastien Douheret + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + * + */ + package main import ( "encoding/json" - "github.com/iotbzh/xds-agent/lib/apiv1" + "github.com/iotbzh/xds-agent/lib/xaapiv1" "github.com/urfave/cli" ) -var cacheXdsVersion *apiv1.XDSVersion +var cacheXdsVersion *xaapiv1.XDSVersion // XdsVersionGet Get version of XDS agent & server -func XdsVersionGet(ver *apiv1.XDSVersion) error { +func XdsVersionGet(ver *xaapiv1.XDSVersion) error { // Use cached data if cacheXdsVersion != nil { ver = cacheXdsVersion return nil } - dataVer := apiv1.XDSVersion{} + dataVer := xaapiv1.XDSVersion{} if err := HTTPCli.Get("/version", &dataVer); err != nil { return err } @@ -29,7 +47,7 @@ func XdsVersionGet(ver *apiv1.XDSVersion) error { // XdsServerIDGet returns the XDS Server ID func XdsServerIDGet() string { - ver := apiv1.XDSVersion{} + ver := xaapiv1.XDSVersion{} if err := XdsVersionGet(&ver); err != nil { return "" } @@ -46,7 +64,7 @@ func XdsServerIndexGet() int { } // ProjectsListGet Get the list of existing projects -func ProjectsListGet(prjs *[]apiv1.ProjectConfig) error { +func ProjectsListGet(prjs *[]xaapiv1.ProjectConfig) error { var data []byte if err := HTTPCli.HTTPGet("/projects", &data); err != nil { return err