manufacturer

package
v0.0.0-...-555a65a Latest Latest
Warning

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

Go to latest
Published: May 23, 2024 License: MIT Imports: 24 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func AdminAuthorization

func AdminAuthorization(c *gin.Context)

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 ConnectionDTO struct {
	ConnectionType  string         `json:"connectionType" default:"simple-CoAP"`
	ConnectionModel map[string]any `json:"connectionModel" `
}

type ControllCommandDTO

type ControllCommandDTO struct {
	ServiceDefinition string `json:"serviceDefinition" default:"lamp"`
	ServiceUri        string `json:"serviceUri" default:"/lamp"`
}

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 NewManufacturer(address string, port int, domainAddress string, domainPort int, systemName string, serviceRegistryAddress string, serviceRegistryPort int, services []models.ServiceDefinition) (*Manufacturer, error)

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 NewService(serviceRegistryAddress string, serviceRegistryPort int) (*Service, error)

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 *Service) DeleteDigitalTwin(address string, port int) error

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

type SystemDefinitionDTO

type SystemDefinitionDTO struct {
	Address            string `json:"address" default:"localhost"`
	Port               int    `json:"port" default:"5000"`
	SystemName         string `json:"systemName" default:"my-digital-twin"`
	AuthenticationInfo string `json:"authenticationInfo"`
}

Jump to

Keyboard shortcuts

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