Documentation ¶
Overview ¶
Package httpadapter is a package to process RESTful message
Index ¶
- type RestController
- func (c *RestController) AddDevice(writer http.ResponseWriter, request *http.Request)
- func (c *RestController) InitRestRoutes()
- func (c *RestController) Ping(writer http.ResponseWriter, request *http.Request)
- func (c *RestController) ReadCommand(writer http.ResponseWriter, request *http.Request)
- func (c *RestController) RemoveDevice(writer http.ResponseWriter, request *http.Request)
- func (c *RestController) WriteCommand(writer http.ResponseWriter, request *http.Request)
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
This section is empty.
Types ¶
type RestController ¶
RestController the struct of HTTP route
func NewRestController ¶
func NewRestController(r *mux.Router, dic *di.Container) *RestController
NewRestController build a RestController
func (*RestController) AddDevice ¶
func (c *RestController) AddDevice(writer http.ResponseWriter, request *http.Request)
AddDevice Restful API to addDevice
func (*RestController) InitRestRoutes ¶
func (c *RestController) InitRestRoutes()
InitRestRoutes register the RESTful API
func (*RestController) Ping ¶
func (c *RestController) Ping(writer http.ResponseWriter, request *http.Request)
Ping handles the requests to /ping endpoint. Is used to test if the service is working It returns a response as specified by the V1 API swagger in openAPI/common
func (*RestController) ReadCommand ¶
func (c *RestController) ReadCommand(writer http.ResponseWriter, request *http.Request)
ReadCommand Restful API to read data from the device
func (*RestController) RemoveDevice ¶
func (c *RestController) RemoveDevice(writer http.ResponseWriter, request *http.Request)
RemoveDevice Restful API to remove device
func (*RestController) WriteCommand ¶
func (c *RestController) WriteCommand(writer http.ResponseWriter, request *http.Request)
WriteCommand Restful API to write data to the device
Click to show internal directories.
Click to hide internal directories.