controller

package
v1.0.0 Latest Latest
Warning

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

Go to latest
Published: Jun 26, 2019 License: Apache-2.0 Imports: 19 Imported by: 0

Documentation

Index

Constants

View Source
const (
	OPCUA     = "opcua"
	ModbusRTU = "modbus-rtu"
	ModbusTCP = "modbus-tcp"
	Modbus    = "modbus"
	Bluetooth = "bluetooth"

	DataTypeInt    = "int"
	DataTypeString = "string"

	ConfigMapKind    = "ConfigMap"
	ConfigMapVersion = "v1"

	DeviceProfileConfigPrefix = "device-profile-config-"

	DeviceProfileJSON = "deviceProfile.json"
)

Constants for protocol, datatype, configmap, deviceProfile

View Source
const (
	// MergePatchType is patch type
	MergePatchType = "application/merge-patch+json"
	// ResourceTypeDevices is plural of device resource in apiserver
	ResourceTypeDevices = "devices"
)

Variables

This section is empty.

Functions

This section is empty.

Types

type CacheDevice

type CacheDevice struct {
	metav1.ObjectMeta
	Spec   v1alpha1.DeviceSpec
	Status v1alpha1.DeviceStatus
}

CacheDevice is the struct save device data for check device is really changed

type CacheDeviceModel

type CacheDeviceModel struct {
	metav1.ObjectMeta
	Spec v1alpha1.DeviceModelSpec
}

CacheDeviceModel is the struct save DeviceModel data for check DeviceModel is really changed

type DeviceStatus

type DeviceStatus struct {
	Status v1alpha1.DeviceStatus `json:"status"`
}

DeviceStatus is structure to patch device status

type DownstreamController

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

DownstreamController watch kubernetes api server and send change to edge

func NewDownstreamController

func NewDownstreamController() (*DownstreamController, error)

NewDownstreamController create a DownstreamController from config

func (*DownstreamController) Start

func (dc *DownstreamController) Start() error

Start DownstreamController

func (*DownstreamController) Stop

func (dc *DownstreamController) Stop() error

Stop DownstreamController

type UpstreamController

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

UpstreamController subscribe messages from edge and sync to k8s api server

func NewUpstreamController

func NewUpstreamController(dc *DownstreamController) (*UpstreamController, error)

NewUpstreamController create UpstreamController from config

func (*UpstreamController) Start

func (uc *UpstreamController) Start() error

Start UpstreamController

func (*UpstreamController) Stop

func (uc *UpstreamController) Stop() error

Stop UpstreamController

Jump to

Keyboard shortcuts

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