Commit bed19be3 authored by Michel Roy's avatar Michel Roy Committed by Kevin Di Lallo
Browse files

swagger update

parent 3bcea5ec
Loading
Loading
Loading
Loading
+1 −1
Original line number Diff line number Diff line
2.3.1
 No newline at end of file
2.4.9
 No newline at end of file
+1 −0
Original line number Diff line number Diff line
cloud.google.com/go v0.34.0/go.mod h1:aQUYkXzVsufM+DwF1aE+0xfcU+56JwCaLick0ClmMTw=
github.com/antihax/optional v1.0.0/go.mod h1:uupD/76wgC+ih3iEmQUL+0Ugr19nfwCT1kdvxnR2qWY=
github.com/golang/protobuf v1.2.0 h1:P3YflyNX/ehuJFLhxviNdFxQPkGK5cDcApsge1SqnvM=
github.com/golang/protobuf v1.2.0/go.mod h1:6lQm79b+lXiMfvg/cZm0SGofjICqVBUtrP5yJMmIC1U=
github.com/gorilla/handlers v1.4.0 h1:XulKRWSQK5uChr4pEgSE4Tc/OcmnU9GJuSwdog/tZsA=
+25 −0
Original line number Diff line number Diff line
@@ -10,10 +10,35 @@
package server

import (
	"encoding/json"
	"fmt"
	"net/http"
	"os"
	"strings"
)

func GetEdgeInfo(w http.ResponseWriter, r *http.Request) {
	w.Header().Set("Content-Type", "application/json; charset=UTF-8")

	var edgeInfo EdgeInfo
	//podName := os.Getenv("MEEP_POD_NAME")
	serviceName := os.Getenv("MGM_APP_ID")
	newString := strings.ToUpper(serviceName) + "_SERVICE_HOST"
	newString = strings.Replace(newString, "-", "_", -1)

	svcName := os.Getenv("MGM_GROUP_NAME")

	edgeInfo.Svc = svcName
	edgeInfo.Name = serviceName //podName
	edgeInfo.Ip = os.Getenv(newString)
	// Format response
	jsonResponse, err := json.Marshal(edgeInfo)
	if err != nil {
		http.Error(w, err.Error(), http.StatusInternalServerError)
		return
	}

	// Send response
	w.WriteHeader(http.StatusOK)
	fmt.Fprint(w, string(jsonResponse))
}
+2 −2
Original line number Diff line number Diff line
@@ -14,6 +14,6 @@ import (
)

func PostTrackingNotification(w http.ResponseWriter, r *http.Request) {
	w.Header().Set("Content-Type", "application/json; charset=UTF-8")
	w.WriteHeader(http.StatusOK)
	localDBUpdateTrackedUes(w, r)

}
+1 −2
Original line number Diff line number Diff line
@@ -14,6 +14,5 @@ import (
)

func HandleEvent(w http.ResponseWriter, r *http.Request) {
	w.Header().Set("Content-Type", "application/json; charset=UTF-8")
	w.WriteHeader(http.StatusOK)
	localDBHandleEvent(w, r)
}
Loading