X-Git-Url: https://gerrit.automotivelinux.org/gerrit/gitweb?p=src%2Fxds%2Fxds-cli.git;a=blobdiff_plain;f=utils.go;h=65b67d3fc78ee79080b3df544b8030329999d0a2;hp=d6324151d9af855fd29b397cf5d85af6f34d676e;hb=397a6038d7d88d21c8577f1c7267849ba5814080;hpb=6f71a805b2f6f961761b5906a21d2a234b84aa4c diff --git a/utils.go b/utils.go index d632415..65b67d3 100644 --- a/utils.go +++ b/utils.go @@ -21,6 +21,7 @@ package main import ( "encoding/json" "fmt" + "strconv" "github.com/franciscocpg/reflectme" "github.com/iotbzh/xds-agent/lib/xaapiv1" @@ -83,6 +84,11 @@ func XdsServerIndexGet() int { return 0 } +// XdsServerComputeURL computes the URL used to access to XDS Server API +func XdsServerComputeURL(endURL string) string { + return "servers/" + strconv.Itoa(XdsServerIndexGet()) + endURL +} + // ProjectsListGet Get the list of existing projects func ProjectsListGet(prjs *[]xaapiv1.ProjectConfig) error { var data []byte