X-Git-Url: https://gerrit.o-ran-sc.org/r/gitweb?a=blobdiff_plain;f=pkg%2Fnbi%2Fhttpgetter.go;h=bdcc435291908b3bf2ab08891a5e11e4817bea6a;hb=aaf8d396257a455247b24716a32b05fc3fd145c2;hp=93ef5321920f9fc51a4937968b424c2e23de93c2;hpb=eb2ff0d217caf158dd15424bf70f8aa79c3742b1;p=ric-plt%2Frtmgr.git diff --git a/pkg/nbi/httpgetter.go b/pkg/nbi/httpgetter.go index 93ef532..bdcc435 100644 --- a/pkg/nbi/httpgetter.go +++ b/pkg/nbi/httpgetter.go @@ -35,20 +35,20 @@ import ( ) type HttpGetter struct { - NbiEngine - FetchAllXapps FetchAllXappsHandler + Engine + FetchAllXApps FetchAllXAppsHandler } func NewHttpGetter() *HttpGetter { instance := new(HttpGetter) - instance.FetchAllXapps = fetchAllXapps + instance.FetchAllXApps = fetchAllXApps return instance } var myClient = &http.Client{Timeout: 5 * time.Second} -func fetchAllXapps(xmurl string) (*[]rtmgr.XApp, error) { - rtmgr.Logger.Info("Invoked httpgetter.fetchXappList: " + xmurl) +func fetchAllXApps(xmurl string) (*[]rtmgr.XApp, error) { + rtmgr.Logger.Info("Invoked httpGetter.fetchXappList: " + xmurl) r, err := myClient.Get(xmurl) if err != nil { return nil, err @@ -57,21 +57,21 @@ func fetchAllXapps(xmurl string) (*[]rtmgr.XApp, error) { if r.StatusCode == 200 { rtmgr.Logger.Debug("http client raw response: %v", r) - var xapps []rtmgr.XApp - err = json.NewDecoder(r.Body).Decode(&xapps) + var xApps []rtmgr.XApp + err = json.NewDecoder(r.Body).Decode(&xApps) if err != nil { rtmgr.Logger.Warn("Json decode failed: " + err.Error()) } rtmgr.Logger.Info("HTTP GET: OK") - rtmgr.Logger.Debug("httpgetter.fetchXappList returns: %v", xapps) - return &xapps, err + rtmgr.Logger.Debug("httpGetter.fetchXappList returns: %v", xApps) + return &xApps, err } - rtmgr.Logger.Warn("httpgetter got an unexpected http status code: %v", r.StatusCode) + rtmgr.Logger.Warn("httpGetter got an unexpected http status code: %v", r.StatusCode) return nil, nil } func (g *HttpGetter) Initialize(xmurl string, nbiif string, fileName string, configfile string, - sdlEngine sdl.SdlEngine, rpeEngine rpe.RpeEngine, triggerSBI chan<- bool) error { + sdlEngine sdl.Engine, rpeEngine rpe.Engine, triggerSBI chan<- bool) error { return nil }