analytics

package
v0.0.7 Latest Latest
Warning

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

Go to latest
Published: Mar 15, 2024 License: Apache-2.0 Imports: 18 Imported by: 0

Documentation

Index

Constants

View Source
const DeviceFilterType = "deviceId"
View Source
const ImportFilterType = "ImportId"

Variables

View Source
var Factory = &FactoryType{}

Functions

func ServiceIdToTopic

func ServiceIdToTopic(id string) string

Types

type Analytics

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

func (*Analytics) DeployDevice

func (this *Analytics) DeployDevice(token auth.AuthToken, label string, user string, deploymentId string, flowId string, eventId string, deviceId string, serviceId string, value string, path string, castFrom string, castTo string, castExtensions []model.ConverterExtension) (pipelineId string, err error)

func (*Analytics) DeployDeviceWithMarshaller

func (this *Analytics) DeployDeviceWithMarshaller(token auth.AuthToken, label string, user string, deploymentId string, flowId string, eventId string, deviceId string, serviceId string, value string, path string, functionId string, aspectNodeId string, targetCharacteristicId string) (pipelineId string, err error)

func (*Analytics) DeployGenericSource

func (this *Analytics) DeployGenericSource(token auth.AuthToken, label string, user string, desc model.GroupEventDescription, path string, castFrom string, castTo string, castExtensions []model.ConverterExtension) (pipelineId string, err error)

func (*Analytics) DeployGroup

func (this *Analytics) DeployGroup(token auth.AuthToken, label string, user string, desc model.GroupEventDescription, serviceIds []string, serviceToDeviceIdsMapping map[string][]string, serviceToPathsMapping map[string][]string, serviceToPathAndCharacteristic map[string][]model.PathAndCharacteristic, castExtensions []model.ConverterExtension, useMarshaller bool) (pipelineId string, err error)

func (*Analytics) DeployImport

func (this *Analytics) DeployImport(token auth.AuthToken, label string, user string, desc model.GroupEventDescription, topic string, path string, castFrom string, castTo string, castExtensions []model.ConverterExtension) (pipelineId string, err error)

func (*Analytics) GetEventStates

func (this *Analytics) GetEventStates(owner string, eventIds []string) (states map[string]bool, err error)

func (*Analytics) GetFlowInputs

func (this *Analytics) GetFlowInputs(id string, user string) (result []FlowModelCell, err error, code int)

func (*Analytics) GetPipelineByEventId

func (this *Analytics) GetPipelineByEventId(owner string, eventId string) (pipelineId string, exists bool, err error)

func (*Analytics) GetPipelinesByDeploymentId

func (this *Analytics) GetPipelinesByDeploymentId(owner string, deploymentId string) (pipelineIds []string, err error)

func (*Analytics) GetPipelinesByDeviceGroupId

func (this *Analytics) GetPipelinesByDeviceGroupId(owner string, groupId string) (pipelineIds []string, pipelineToGroupDescription map[string]model.GroupEventDescription, pipelineNames map[string]string, err error)

func (*Analytics) Remove

func (this *Analytics) Remove(user string, pipelineId string) error

func (*Analytics) UpdateGroupDeployment

func (this *Analytics) UpdateGroupDeployment(token auth.AuthToken, pipelineId string, label string, user string, desc model.GroupEventDescription, serviceIds []string, serviceToDeviceIdsMapping map[string][]string, serviceToPathsMapping map[string][]string, serviceToPathAndCharacteristic map[string][]model.PathAndCharacteristic, castExtensions []model.ConverterExtension, useMarshaller bool) (err error)

type CellConfig

type CellConfig struct {
	Name string `json:"name,omitempty"`
	Type string `json:"type,omitempty"`
}

type EventNode

type EventNode struct {
	Id      string       `json:"id"`
	Name    string       `json:"name"`
	Configs []NodeConfig `json:"configs"`
}

type EventPipelineDescription

type EventPipelineDescription struct {
	GenericEventSource *deploymentmodel.GenericEventSource `json:"generic_event_source,omitempty"`
	ImportId           string                              `json:"import_id,omitempty"`
	DeviceGroupId      string                              `json:"device_group_id,omitempty"`
	DeviceId           string                              `json:"device_id,omitempty"`
	ServiceId          string                              `json:"service_id,omitempty"`
	FunctionId         string                              `json:"function_id,omitempty"`
	AspectId           string                              `json:"aspect_id,omitempty"`
	ValuePath          string                              `json:"value_path,omitempty"`
	OperatorValue      string                              `json:"operator_value"`
	EventId            string                              `json:"event_id"`
	DeploymentId       string                              `json:"deployment_id"`
	FlowId             string                              `json:"flow_id,omitempty"`
	UseMarshaller      bool                                `json:"use_marshaller,omitempty"`
}

type FactoryType

type FactoryType struct{}

func (*FactoryType) New

func (this *FactoryType) New(ctx context.Context, config config.Config) (interfaces.Analytics, error)

type Flow

type Flow struct {
	Id          string    `json:"_id"`
	Name        string    `json:"name"`
	Description string    `json:"description"`
	Model       FlowModel `json:"model"`
}

type FlowModel

type FlowModel struct {
	Cells []FlowModelCell `json:"cells"`
}

type FlowModelCell

type FlowModelCell struct {
	Id             string                 `json:"id"`
	Name           string                 `json:"name"`
	DeploymentType string                 `json:"deploymentType"`
	InPorts        []string               `json:"inPorts,omitempty"`
	OutPorts       []string               `json:"outPorts,omitempty"`
	Type           string                 `json:"type"`
	Source         map[string]interface{} `json:"source"`
	Target         map[string]interface{} `json:"target"`
	Image          string                 `json:"image"`
	Config         []CellConfig           `json:"config,omitempty"`
	OperatorId     string                 `json:"operatorId"`
}

type InputTopic

type InputTopic struct {
	Name        string    `json:"name,omitempty"`
	FilterType  string    `json:"filterType,omitempty"`
	FilterValue string    `json:"filterValue,omitempty"`
	Mappings    []Mapping `json:"mappings,omitempty"`
}

type Mapping

type Mapping struct {
	Dest   string `json:"dest,omitempty"`
	Source string `json:"source,omitempty"`
}

type NodeConfig

type NodeConfig struct {
	Name  string `json:"name,omitempty"`
	Value string `json:"value,omitempty"`
}

type NodeInput

type NodeInput struct {
	FilterIds  string      `json:"filterIds,omitempty"`
	FilterType string      `json:"filterType"`
	TopicName  string      `json:"topicName,omitempty"`
	Values     []NodeValue `json:"values,omitempty"`
}

type NodeValue

type NodeValue struct {
	Name string `json:"name,omitempty"`
	Path string `json:"path,omitempty"`
}

type Operator

type Operator struct {
	Id             string            `json:"id,omitempty"`
	Name           string            `json:"name,omitempty"`
	ImageId        string            `json:"imageId,omitempty"`
	DeploymentType string            `json:"deploymentType,omitempty"`
	OperatorId     string            `json:"operatorId,omitempty"`
	Config         map[string]string `json:"config,omitempty"`
	InputTopics    []InputTopic
}

type Pipeline

type Pipeline struct {
	Id          uuid.UUID  `json:"id,omitempty"`
	Name        string     `json:"name,omitempty"`
	Description string     `json:"description,omitempty"`
	Operators   []Operator `json:"operators,omitempty"`
}

type PipelineNode

type PipelineNode struct {
	NodeId string       `json:"nodeId,omitempty"`
	Inputs []NodeInput  `json:"inputs,omitempty"`
	Config []NodeConfig `json:"config,omitempty"`
}

type PipelineRequest

type PipelineRequest struct {
	Id          string         `json:"id,omitempty"`
	FlowId      string         `json:"flowId,omitempty"`
	Name        string         `json:"name,omitempty"`
	Description string         `json:"description,omitempty"`
	WindowTime  int            `json:"windowTime,omitempty"`
	Nodes       []PipelineNode `json:"nodes,omitempty"`
}

Jump to

Keyboard shortcuts

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