Documentation ¶
Index ¶
- func AdminAuthorization(c *gin.Context)
- type AdditionalServiceStoredData
- type AnomalyDTO
- type CertificateDTO
- type ConnectionDTO
- type ControllCommandDTO
- type Controller
- type DigitalTwinDTO
- type DigitalTwinStoredData
- type EventHandlerStoredData
- type Manufacturer
- type SensedPropertyDTO
- type Service
- func (service *Service) CreateDigitalTwin(digitalTwinModel models.DigitalTwinModel, systemName string, port int, ...) (*serviceModels.SystemDefinition, error)
- func (service *Service) DeleteDigitalTwin(address string, port int) error
- func (service *Service) GetCertificates(certificateId string) (*models.CertificateModel, error)
- func (service *Service) UploadCertificates(certFileName string, keyFileName string) models.CertificateModel
- type SystemDefinitionDTO
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
func AdminAuthorization ¶
Types ¶
type AdditionalServiceStoredData ¶
type AdditionalServiceStoredData struct { ServiceId string `bson:"serviceId"` DigitalTwinId uuid.UUID `bson:"digitalTwinId"` ServiceType additionalservice.ServiceType `bson:"serviceType"` }
type AnomalyDTO ¶
type AnomalyDTO struct {
AnomalyType string `json:"anomalyType" default:"stuck"`
}
type CertificateDTO ¶
type CertificateDTO struct {
CertificateId string `json:"certificateId" defualt:"ce833540-6430-4d7e-b0e0-55b46a99103b"`
}
type ConnectionDTO ¶
type ControllCommandDTO ¶
type Controller ¶
type Controller struct {
// contains filtered or unexported fields
}
func NewController ¶
func NewController(service *Service) *Controller
func (*Controller) CreateDigitalTwin ¶
func (controller *Controller) CreateDigitalTwin(c *gin.Context)
Create a new digital twin @Summary Create a new digital twin @Description Create a new digital twin based on the given JSON object. This will create a connection to the physical twin based on the connection info given, this will also include generating endpoints to controll and view sensed data. @Tags Management @Produce json @Param DigitalTwin body DigitalTwinDTO true "DigitalTwinDTO JSON" @Success 200 {object} SystemDefinitionDTO @Router /create-digital-twin [post]
func (*Controller) DeleteDigitalTwin ¶
func (controller *Controller) DeleteDigitalTwin(c *gin.Context)
Delete a digital twin @Summary Delete a digital twin @Description Delete a digital twin based on the given address and port. @Tags Management @Param address query string true "address" @Param port query string true "port " @Success 200 @Router /remove-digital-twin [delete]
func (*Controller) UploadCertificates ¶
func (controller *Controller) UploadCertificates(c *gin.Context)
Upload certificate files @Summary Upload certificate files as zip @Description Upload certificate files as zip, to be used by a digital twin. Takes cert.pem and key.pem files and gives `certId`. @Tags Management @Produce json @Param cert formData file true "Cert file" @Param key formData file true "Key file" @Success 200 {object} CertificateDTO @Router /upload-certificates [post]
type DigitalTwinDTO ¶
type DigitalTwinDTO struct { SensedProperties []SensedPropertyDTO ControlCommands []ControllCommandDTO HandleableAnomalies []AnomalyDTO CertificateDTO SystemName string `json:"systemName" defualt:"my-digital-twin"` Port string `json:"port" defualt:"40000"` PhysicalTwinConnection ConnectionDTO }
type DigitalTwinStoredData ¶
type DigitalTwinStoredData struct { DigitalTwinId uuid.UUID `bson:"digitalTwinId"` DigitalTwinModel models.DigitalTwinModel `bson:"digitalTwinModel"` SystemDefinition serviceModels.SystemDefinition `bson:"systemDefinition"` }
type EventHandlerStoredData ¶
type EventHandlerStoredData struct { DigitalTwinId uuid.UUID `bson:"digitalTwinId"` EventHandlerImplementation eventhandlertypes.EventHandlerImplementationType `bson:"eventHandlerImplementation"` EventHandlerAddress string `bson:"eventHandlerAddress"` EventHandlerPort int `bson:"eventHandlerPort"` EventHandlerDomainAddress string `bson:"eventHandlerDomainAddress"` EventHandlerDomainPort int `bson:"eventHandlerDomainPort"` SystemName string `bson:"systemName"` }
type Manufacturer ¶
type Manufacturer struct { models.SystemDefinition SystemAddress string SystemPort int ServiceRegistryConnection serviceregistry.ServiceRegistryConnection Services []models.ServiceDefinition Service *Service }
func NewManufacturer ¶
func (Manufacturer) RunManufacturer ¶
func (manufacturer Manufacturer) RunManufacturer() error
func (Manufacturer) StopManufacturer ¶
func (manufacturer Manufacturer) StopManufacturer() error
type SensedPropertyDTO ¶
type SensedPropertyDTO struct { ServiceDefinition string `json:"serviceDefinition" default:"temperature"` ServiceUri string `json:"serviceUri" default:"/temperature"` SensorEndpointMode string `json:"sensorEndpointMode" default:"INTERVAL_RETRIEVAL"` IntervalTime int `json:"intervalTime" default:"10"` }
type Service ¶
type Service struct {
// contains filtered or unexported fields
}
func NewService ¶
func (*Service) CreateDigitalTwin ¶
func (service *Service) CreateDigitalTwin(digitalTwinModel models.DigitalTwinModel, systemName string, port int, anomalies []additionalservice.Anomaly) (*serviceModels.SystemDefinition, error)
func (*Service) DeleteDigitalTwin ¶
func (*Service) GetCertificates ¶
func (service *Service) GetCertificates(certificateId string) (*models.CertificateModel, error)
func (*Service) UploadCertificates ¶
func (service *Service) UploadCertificates(certFileName string, keyFileName string) models.CertificateModel