analytics

package
v0.0.16 Latest Latest
Warning

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

Go to latest
Published: Jan 7, 2025 License: Apache-2.0 Imports: 18 Imported by: 0

Documentation

Index

Constants

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

Variables

View Source
var DefaultTimeout = 30 * time.Second

Functions

func ServiceIdToTopic

func ServiceIdToTopic(id string) string

Types

type Analytics

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

func New

func New(config Config, libConfig configuration.Config, auth *auth.Auth, smartServiceRepo SmartServiceRepo, imports Imports, devices Devices) *Analytics

func (*Analytics) Do

func (this *Analytics) Do(task model.CamundaExternalTask) (modules []model.Module, outputs map[string]interface{}, err error)

func (*Analytics) GetFlowInputs

func (this *Analytics) GetFlowInputs(token auth.Token, id string) (result []FlowModelCell, err error, code int)

func (*Analytics) Remove

func (this *Analytics) Remove(token auth.Token, pipelineId string) error

func (*Analytics) SendDeployRequest

func (this *Analytics) SendDeployRequest(token auth.Token, request PipelineRequest) (result Pipeline, err error, code int)

func (*Analytics) SendUpdateRequest

func (this *Analytics) SendUpdateRequest(token auth.Token, request PipelineRequest) (result Pipeline, err error, code int)

func (*Analytics) Undo

func (this *Analytics) Undo(modules []model.Module, reason error)

type CellConfig

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

type Config

type Config struct {
	WorkerParamPrefix   string `json:"worker_param_prefix"`
	FlowEngineUrl       string `json:"flow_engine_url"`
	FlowParserUrl       string `json:"flow_parser_url"`
	ImportDeployUrl     string `json:"import_deploy_url"`
	DeviceRepositoryUrl string `json:"device_repository_url"`
	Debug               bool   `json:"debug"`

	EnableMultiplePaths bool   `json:"enable_multiple_paths"`
	DevicePathPrefix    string `json:"device_path_prefix"`
	GroupPathPrefix     string `json:"group_path_prefix"`
	ImportPathPrefix    string `json:"import_path_prefix"`

	RemoveImportPathRoot bool `json:"remove_import_path_root"`
}

type Devices

type Devices interface {
	GetDeviceInfosOfGroup(token auth.Token, groupId string) (devices []devices.Device, deviceTypeIds []string, err error)
	GetDeviceInfosOfDevices(token auth.Token, deviceIds []string) (devices []devices.Device, deviceTypeIds []string, err error)
	GetDeviceTypeSelectables(token auth.Token, criteria []devices.FilterCriteria, includeModified bool, servicesMustMatchAllCriteria bool) (result []devices.DeviceTypeSelectable, err error)
}

type EventNode

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

type EventPipelineDescription

type EventPipelineDescription struct {
	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"`
}

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 Imports

type Imports interface {
	GetTopic(token auth.Token, importId string) (topic string, err error)
}

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"`
	PersistData bool         `json:"persistData,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"`
	ConsumeAllMessages bool           `json:"consumeAllMessages,omitempty"`
	MergeStrategy      string         `json:"mergeStrategy,omitempty"`
	Nodes              []PipelineNode `json:"nodes,omitempty"`
}

type SmartServiceRepo

type SmartServiceRepo interface {
	GetInstanceUser(instanceId string) (userId string, err error)
	ListExistingModules(processInstanceId string, query model.ModulQuery) (result []model.SmartServiceModule, err error)
}

Jump to

Keyboard shortcuts

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