service

package
v0.0.66 Latest Latest
Warning

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

Go to latest
Published: Nov 17, 2025 License: Apache-2.0 Imports: 26 Imported by: 0

Documentation

Index

Constants

View Source
const RequestDeviceId = "deviceId"
View Source
const RequestOperatorId = "operatorId"

Variables

This section is empty.

Functions

func CloseMQTTConnection

func CloseMQTTConnection()

func ConnectMQTTBroker

func ConnectMQTTBroker(config config.MqttConfig, pipelineService PipelineApiService) error

func GenerateFogOperatorStartCommand

func GenerateFogOperatorStartCommand(operator pipe.Operator, pipelineID string, inputTopics []operatorLib.InputTopic) operatorLib.StartOperatorControlCommand

func StringInSlice

func StringInSlice(a string, list []string) bool

Types

type DeviceManagerService

type DeviceManagerService interface {
	GetDevice(deviceID, userID, token string) (models.Device, error)
	GetDeviceType(deviceTypeID, userID, token string) (models.DeviceType, error)
}

type Driver

type Driver interface {
	CreateOperators(pipelineId string, input []pipe.Operator, pipelineConfig lib.PipelineConfig) error
	/*
		DeleteOperator deletes an operator in the given pipeline
		Deprecated: Use DeleteOperators instead.
	*/
	DeleteOperator(pipelineId string, input pipe.Operator) error
	DeleteOperators(pipelineId string, inputs []pipe.Operator) error
	GetPipelineStatus(pipelineId string) (lib.PipelineStatus, error)
	GetPipelinesStatus() ([]lib.PipelineStatus, error)
}

type FlowEngine

type FlowEngine struct {
	// contains filtered or unexported fields
}

func NewFlowEngine

func NewFlowEngine(
	driver Driver,
	parsingService ParsingApiService,
	permissionService PermissionApiService,
	kafak2mqttService Kafka2MqttApiService,
	deviceManagerService DeviceManagerService,
	pipelineService PipelineApiService) *FlowEngine

func (*FlowEngine) DeletePipeline

func (f *FlowEngine) DeletePipeline(id string, userId string, token string) (err error)

func (*FlowEngine) GetPipelineStatus

func (f *FlowEngine) GetPipelineStatus(id, userId, token string) (status lib.PipelineStatus, err error)

func (*FlowEngine) GetPipelinesStatus

func (f *FlowEngine) GetPipelinesStatus(ids []string, userId, token string) (status []lib.PipelineStatus, err error)

func (*FlowEngine) StartPipeline

func (f *FlowEngine) StartPipeline(pipelineRequest lib.PipelineRequest, userId string, token string) (pipeline pipe.Pipeline, err error)

func (*FlowEngine) UpdatePipeline

func (f *FlowEngine) UpdatePipeline(pipelineRequest lib.PipelineRequest, userId string, token string) (pipeline pipe.Pipeline, err error)

type FogClient

type FogClient struct {
	// contains filtered or unexported fields
}

func NewFogClient

func NewFogClient(pipelineService PipelineApiService) *FogClient

type Kafka2MqttApiService

type Kafka2MqttApiService interface {
	StartOperatorInstance(operatorName, operatorID string, pipelineID, userI, token string) (kafka2mqtt_api.Instance, error)
	RemoveInstance(id, pipelineID, userID, token string) error
}

type ParsingApiService

type ParsingApiService interface {
	GetPipeline(id string, userId string, authorization string) (p parser.Pipeline, err error)
}

type PermissionApiService

type PermissionApiService interface {
	UserHasDevicesReadAccess(ids []string, authorization string) (bool, error)
}

type PipelineApiService

type PipelineApiService interface {
	RegisterPipeline(pipeline *pipe.Pipeline, userId string, authorization string) (id uuid.UUID, err error)
	UpdatePipeline(pipeline *pipe.Pipeline, userId string, authorization string) (err error)
	GetPipeline(id string, userId string, authorization string) (pipe pipe.Pipeline, err error)
	GetPipelines(userId string, authorization string) (pipelines []pipe.Pipeline, err error)
	DeletePipeline(id string, userId string, authorization string) (err error)
}

Jump to

Keyboard shortcuts

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