distro

package
v0.0.0-...-545b273 Latest Latest
Warning

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

Go to latest
Published: Mar 25, 2026 License: Apache-2.0 Imports: 47 Imported by: 0

README

EdgeX Foundry Export Distro Service

license

Export Distribution Microservice receives data from core data (via Q) and then filters, transforms, formats the data per client request and finally distributes it via REST, MQTT or 0MQ. Built on the concept of EAI or pipe and filter archtitecture.

Install and Deploy Native

Prerequisites

Serveral EdgeX Foundry services depend on ZeroMQ for communications by default. The easiest way to get and install ZeroMQ is to use or follow the following setup script: https://gist.github.com/katopz/8b766a5cb0ca96c816658e9407e83d00.

Note: Setup of the ZeroMQ library is not supported on Windows plaforms.

Installation and Execution

To fetch the code and build the microservice execute the following:

cd $GOPATH/src
go get github.com/Circutor/edgex
cd $GOPATH/src/github.com/Circutor/edgex
# pull the 3rd party / vendor packages
make prepare
# build the microservice
make cmd/export-distro/export-distro
# get to the export distro microservice executable
cd cmd/export-distro
# run the microservice (may require other dependent services to run correctly)
./export-distro

Community

License

Apache-2.0

Documentation

Overview

******************************************************************************

  • Copyright 2018 Dell Inc. *
  • Licensed under the Apache License, Version 2.0 (the "License"); you may not use this file except
  • in compliance with the License. You may obtain a copy of the License at *
  • http://www.apache.org/licenses/LICENSE-2.0 *
  • Unless required by applicable law or agreed to in writing, software distributed under the License
  • is distributed on an "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express
  • or implied. See the License for the specific language governing permissions and limitations under
  • the License. ******************************************************************************

Copyright (c) 2024 Circutor S.A. All rights reserved.

Index

Constants

This section is empty.

Variables

View Source
var DexmaParameterTable = []struct {
	name    string
	codenum int
}{
	{"POWER", 401},
	{"EACTIVE", 402},
	{"IRPOWER", 403},
	{"IRENERGY", 404},
	{"VOLTAGE", 405},
	{"CURRENT", 406},
	{"CRPOWER", 407},
	{"CRENERGY", 408},
	{"APPOWER", 409},
	{"APENERGY", 410},
	{"COSPHY", 411},
	{"PF", 412},
	{"NCURRENT", 413},
	{"FREQ", 414},
	{"IAENERGY", 415},
	{"IIRENERGY", 416},
	{"IAPENERGY", 417},
	{"MAXDEMAND", 418},
	{"GASVOLUME", 419},
	{"GASENERGY", 420},
	{"GASVOLN", 421},
	{"THDV", 422},
	{"THDC", 423},
	{"IMAXVOLTAGE", 424},
	{"IMAXCURRENT", 425},
	{"AVGCURRENT", 426},
	{"PASEENERGY", 427},
	{"BASEENERGY", 428},
	{"EACTIVEABS", 429},
}

Dexma device parameters list https://docs.google.com/spreadsheets/d/1W97Yv9UWR9iwmXzknxSQSiIzjt4capmWuaZsAwNJD0g/pub?hl=en&hl=en&single=true&gid=0&output=html

View Source
var LoggingClient logger.LoggingClient

Functions

func Destruct

func Destruct()

func GetRegistrationConnectionStatus

func GetRegistrationConnectionStatus() []connectionStatusResponse

GetRegistrationConnectionStatus queries the connection status of all registrations

func Init

func Init() bool

func Loop

func Loop(errChan chan error, eventCh chan *models.Event)

Loop - registration loop

func NewScoutWebsocket

func NewScoutWebsocket() *scoutWebsocket

func RefreshRegistrations

func RefreshRegistrations(update contract.NotifyUpdate)

func Retry

func Retry(useProfile string, timeout int, wait *sync.WaitGroup, ch chan error)

func ZeroMQReceiver

func ZeroMQReceiver(eventCh chan *models.Event)

Types

type AzureMessage

type AzureMessage struct {
	ID             string            `json:"id"`
	SequenceNumber int64             `json:"sequenceNumber"`
	To             string            `json:"To"`
	Created        time.Time         `json:"CreationTimeUtc"`
	Expire         time.Time         `json:"ExpiryTimeUtc"`
	Enqueued       time.Time         `json:"EnqueuedTime"`
	CorrelationID  string            `json:"CorrelationId"`
	UserID         string            `json:"userId"`
	Ack            feedbackCode      `json:"ack"`
	ConnDevID      string            `json:"connectionDeviceId"`
	ConnDevGenID   string            `json:"connectionDeviceGenerationId"`
	ConnAuthMethod connAuthMethod    `json:"connectionAuthMethod,omitempty"`
	Body           []byte            `json:"body"`
	Properties     map[string]string `json:"properties"`
}

AzureMessage represents Azure IoT Hub message.

func (*AzureMessage) AddProperty

func (am *AzureMessage) AddProperty(key, value string) error

AddProperty method ads property performing key check.

type BIoTMessage

type BIoTMessage struct {
	Version    string `json:"version"`
	MsgType    string `json:"msgType"`
	FuncType   string `json:"funcType"`
	SId        string `json:"sId"`
	TpId       string `json:"tpId"`
	TId        string `json:"tId"`
	MsgCode    string `json:"msgCode"`
	MsgId      string `json:"msgId"`
	MsgDate    int64  `json:"msgDate"`
	ResCode    string `json:"resCode"`
	ResMsg     string `json:"resMsg"`
	Severity   string `json:"severity"`
	Dataformat string `json:"dataformat"`
	EncType    string `json:"encType"`
	AuthToken  string `json:"authToken"`
	Data       []byte `json:"data"`
}

BIoTMessage represents Brightics IoT(Samsung SDS IoT platform) messages.

type CertificateInfo

type CertificateInfo struct {
	Cert string
	Key  string
}

type ConfigurationStruct

type ConfigurationStruct struct {
	Writable       WritableInfo
	Clients        map[string]config.ClientInfo
	Logging        config.LoggingInfo
	MessageQueue   config.MessageQueueInfo
	AnalyticsQueue config.MessageQueueInfo
	Service        config.ServiceInfo
}
var Configuration *ConfigurationStruct

type FirmwareEntry

type FirmwareEntry struct {
	GatewayType string   `json:"gateway_type"`
	HwVersion   []string `json:"hw_version"`
	MinVersion  string   `json:"min_version"`
	Version     string   `json:"version"` // validate:"semver"`
	Sha256      string   `json:"sha256"`  // validate:"sha256"`
	URL         string   `json:"url"`     // validate:"http_url"`
	Status      string   `json:"status"`
}

func (FirmwareEntry) IsValid

func (fe FirmwareEntry) IsValid() error

type FirmwareResponse

type FirmwareResponse struct {
	Status string          `json:"status"`
	Data   []FirmwareEntry `json:"data"`
}

type HTTPMessage

type HTTPMessage struct {
	RequestID string
	Method    string
	Path      string
	Headers   http.Header
	Body      []byte
}

func ParseHTTPRequest

func ParseHTTPRequest(rawRequest string) (*HTTPMessage, error)

func (*HTTPMessage) ToHTTPRequest

func (m *HTTPMessage) ToHTTPRequest(baseURL string) (*http.Request, error)

type HTTPResponse

type HTTPResponse struct {
	RequestID     string
	StatusCode    int
	StatusMessage string
	Headers       http.Header
	Body          []byte
}

func (*HTTPResponse) FormatHTTPResponse

func (r *HTTPResponse) FormatHTTPResponse() string

type ScoutRestClient

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

func NewScoutRestClient

func NewScoutRestClient(baseURL string) *ScoutRestClient

func (*ScoutRestClient) Get

func (c *ScoutRestClient) Get(path string, v interface{}) error

func (*ScoutRestClient) Post

func (c *ScoutRestClient) Post(path string, v interface{}) error

func (*ScoutRestClient) SetHeader

func (c *ScoutRestClient) SetHeader(key, value string)

type ScoutUpdater

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

func NewScoutUpdater

func NewScoutUpdater(address string, host string, claimID string, token string) *ScoutUpdater

func (*ScoutUpdater) Close

func (m *ScoutUpdater) Close()

type UpdateRequestFromURL

type UpdateRequestFromURL struct {
	Version string `json:"version"`
	Sha256  string `json:"sha256"`
	URL     string `json:"url"`
}

type WritableInfo

type WritableInfo struct {
	MarkPushed bool
	LogLevel   string
}

Jump to

Keyboard shortcuts

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