httpadapter

package
v1.13.0 Latest Latest
Warning

This package is not in the latest version of its module.

Go to latest
Published: Jan 18, 2023 License: Apache-2.0 Imports: 13 Imported by: 0

Documentation

Overview

Package httpadapter is a package to process RESTful message

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type RestController

type RestController struct {
	Router *mux.Router
	// contains filtered or unexported fields
}

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

Directories

Path Synopsis
Package requests used to call define add device request's struct
Package requests used to call define add device request's struct
Package response used to implement the responses structure
Package response used to implement the responses structure

Jump to

Keyboard shortcuts

? : This menu
/ : Search site
f or F : Jump to
y or Y : Canonical URL