edgexfoundry / device-usb-camera

Owner: Device WG
Apache License 2.0
12 stars 28 forks source link

feat: replace gorilla/mux with labstack/echo #276

Closed FelixTing closed 1 year ago

FelixTing commented 1 year ago

This commit refactors the RTSPCredentialsHandler method in the Driver struct from a standard HTTP handler function to an Echo framework handler function. The original function signature:

func (d *Driver) RTSPCredentialsHandler(w http.ResponseWriter, r *http.Request)

has been updated to:

func (d *Driver) RTSPCredentialsHandler(c echo.Context) error

closes #275

If your build fails due to your commit message not passing the build checks, please review the guidelines here: https://github.com/edgexfoundry/edgex-go/blob/main/.github/Contributing.md

PR Checklist

Please check if your PR fulfills the following requirements:

Testing Instructions

Run make docker to build the image From the latest compose-builder run make run no-secty device-dev ds-usb-camera Verify the device-usb-camera service bootstraps successfully and contains the following log message:

level=INFO ts=2023-08-25T14:32:58.176008677Z app=device-usb-camera source=driver.go:217 msg="Starting rtsp authentication server on localhost:8000"

Follow the walkthrough(https://docs.edgexfoundry.org/3.0/microservices/device/supported/device-usb-camera/walkthrough/general-usage/) to play an RTSP stream.

New Dependency Instructions (If applicable)

cloudxxx8 commented 1 year ago

the echo banner in the log should be hidden https://github.com/labstack/echo/issues/928 https://echo.labstack.com/docs/customization#startup-banner

lenny-goodell commented 1 year ago

Tested, functions as expected with RTSP Server enabled and disabled. LGTM!

@seanohair22 , thanks for testing!