Documentation ¶
Index ¶
- Constants
- Variables
- func NewRouter(app app.App, config ...*Config) *gin.Engine
- type APIHandler
- type BulkItem
- type BulkResult
- type Config
- type InternalHandler
- type ManagementHandler
- func (h *ManagementHandler) CreateIntegration(c *gin.Context)
- func (h *ManagementHandler) GetDeviceState(c *gin.Context)
- func (h *ManagementHandler) GetDeviceStateIntegration(c *gin.Context)
- func (h *ManagementHandler) GetEvents(c *gin.Context)
- func (h *ManagementHandler) GetIntegrationById(c *gin.Context)
- func (h *ManagementHandler) GetIntegrations(c *gin.Context)
- func (h *ManagementHandler) RemoveIntegration(c *gin.Context)
- func (h *ManagementHandler) SetDeviceStateIntegration(c *gin.Context)
- func (h *ManagementHandler) SetIntegrationCredentials(c *gin.Context)
Constants ¶
View Source
const ( ParamTenantID = "tenant_id" ParamDeviceID = "device_id" )
View Source
const ( APIURLInternal = "/api/internal/v1/iot-manager" APIURLAlive = "/alive" APIURLHealth = "/health" APIURLTenants = "/tenants" APIURLTenant = APIURLTenants + "/:tenant_id" APIURLTenantAuth = APIURLTenant + "/auth" APIURLTenantDevices = APIURLTenant + "/devices" APIURLTenantDevice = APIURLTenantDevices + "/:device_id" APIURLTenantBulkDevices = APIURLTenant + "/bulk/devices" APIURLTenantBulkStatus = APIURLTenantBulkDevices + "/status/:status" APIURLManagement = "/api/management/v1/iot-manager" APIURLIntegrations = "/integrations" APIURLIntegration = "/integrations/:id" APIURLIntegrationCredentials = APIURLIntegration + "/credentials" APIURLDevice = "/devices/:id" APIURLDeviceState = APIURLDevice + "/state" APIURLDeviceStateIntegration = APIURLDevice + "/state/:integrationId" APIURLEvents = "/events" )
API URL used by the HTTP router
Variables ¶
View Source
var ( ErrMissingUserAuthentication = errors.New( "user identity missing from authorization token", ) ErrIntegrationNotFound = errors.New("integration not found") )
View Source
var ( ErrEmptyDeviceID = errors.New("device ID is empty") ErrInvalidIntegrationID = errors.New("integration ID is not a valid UUID") )
Functions ¶
Types ¶
type APIHandler ¶
func NewAPIHandler ¶
func NewAPIHandler(app app.App, config ...*Config) *APIHandler
func (*APIHandler) Health ¶
func (h *APIHandler) Health(c *gin.Context)
Health responds to GET /health
func (*APIHandler) NoRoute ¶
func (h *APIHandler) NoRoute(c *gin.Context)
type BulkResult ¶
type Config ¶
type InternalHandler ¶
type InternalHandler APIHandler
func (*InternalHandler) BulkSetDeviceStatus ¶
func (h *InternalHandler) BulkSetDeviceStatus(c *gin.Context)
PUT /tenants/:tenant_id/devices/status/{status}
func (*InternalHandler) DecommissionDevice ¶
func (h *InternalHandler) DecommissionDevice(c *gin.Context)
func (*InternalHandler) PreauthorizeHandler ¶
func (h *InternalHandler) PreauthorizeHandler(c *gin.Context)
POST /tenants/:tenant_id/auth
func (*InternalHandler) ProvisionDevice ¶
func (h *InternalHandler) ProvisionDevice(c *gin.Context)
POST /tenants/:tenant_id/devices code: 204 - device provisioned to iothub
500 - internal server error
type ManagementHandler ¶
type ManagementHandler APIHandler
ManagementHandler is the namespace for management API handlers.
func (*ManagementHandler) CreateIntegration ¶
func (h *ManagementHandler) CreateIntegration(c *gin.Context)
POST /integrations
func (*ManagementHandler) GetDeviceState ¶
func (h *ManagementHandler) GetDeviceState(c *gin.Context)
GET /devices/:id/state
func (*ManagementHandler) GetDeviceStateIntegration ¶
func (h *ManagementHandler) GetDeviceStateIntegration(c *gin.Context)
GET /devices/:id/state/:integrationId
func (*ManagementHandler) GetEvents ¶
func (h *ManagementHandler) GetEvents(c *gin.Context)
GET /events
func (*ManagementHandler) GetIntegrationById ¶
func (h *ManagementHandler) GetIntegrationById(c *gin.Context)
GET /integrations/{id}
func (*ManagementHandler) GetIntegrations ¶
func (h *ManagementHandler) GetIntegrations(c *gin.Context)
GET /integrations
func (*ManagementHandler) RemoveIntegration ¶
func (h *ManagementHandler) RemoveIntegration(c *gin.Context)
DELETE /integrations/{id}
func (*ManagementHandler) SetDeviceStateIntegration ¶
func (h *ManagementHandler) SetDeviceStateIntegration(c *gin.Context)
PUT /devices/:id/state/:integrationId
func (*ManagementHandler) SetIntegrationCredentials ¶
func (h *ManagementHandler) SetIntegrationCredentials(c *gin.Context)
PUT /integrations/{id}/credentials
Click to show internal directories.
Click to hide internal directories.