common_interfaces

package
v1.0.6 Latest Latest
Warning

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

Go to latest
Published: Aug 16, 2021 License: MIT Imports: 3 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type IDataStorage

type IDataStorage interface {
	SetItem(name string, value string, UOM string, dt time.Time, flags string) error
	TouchItem(name string) error
	GetItem(name string) (Item, error)
	GetUnitValues(unitId string) []ItemGetUnitItems
	RenameItems(oldPrefix string, newPrefix string)
	RemoveItemsOfUnit(unitName string) error

	Exec(function string, request []byte, host string) ([]byte, error)

	StatGazerNode() StatGazerNode
	StatGazerCloud() StatGazerCloud
}

type IUnit

type IUnit interface {
	Id() string
	SetId(unitId string)
	Type() string
	SetType(unitType string)
	Name() string
	SetName(unitType string)
	SetIUnit(iUnit IUnit)
	MainItem() string
	Start(iDataStorage IDataStorage) error
	Stop()
	IsStarted() bool
	SetConfig(config string)
	GetConfig() string
	GetConfigMeta() string

	InternalUnitStart() error
	InternalUnitStop()
}

type Item

type Item struct {
	Id     uint64    `json:"id"`
	UnitId string    `json:"unit_id"`
	Name   string    `json:"name"`
	Value  ItemValue `json:"value"`

	PostprocessingTrim      bool    `json:"postprocessing_trim"`
	PostprocessingAdjust    bool    `json:"postprocessing_adjust"`
	PostprocessingScale     float64 `json:"postprocessing_scale"`
	PostprocessingOffset    float64 `json:"postprocessing_offset"`
	PostprocessingPrecision int     `json:"postprocessing_precision"`
}

func NewItem

func NewItem() *Item

func (*Item) PostprocessingValue added in v1.0.6

func (c *Item) PostprocessingValue(value string) string

type ItemConfiguration

type ItemConfiguration struct {
	Id   uint64 `json:"id"`
	Name string `json:"name"`
}

type ItemGetUnitItems

type ItemGetUnitItems struct {
	Item
	CloudChannels      []string `json:"cloud_channels"`
	CloudChannelsNames []string `json:"cloud_channels_names"`
}

type ItemValue

type ItemValue struct {
	Value string `json:"v"`
	DT    int64  `json:"t"`
	UOM   string `json:"u"`
}

type Requester added in v1.0.6

type Requester interface {
	RequestJson(function string, requestText []byte, host string) ([]byte, error)
}

type ResourcesInfo

type ResourcesInfo struct {
	TotalCount    int                 `json:"total_count"`
	InFilterCount int                 `json:"in_filter_count"`
	Items         []ResourcesItemInfo `json:"items"`
}

type ResourcesItem

type ResourcesItem struct {
	Info    ResourcesItemInfo `json:"info"`
	Content []byte            `json:"content"`
}

type ResourcesItemInfo

type ResourcesItemInfo struct {
	Id        string `json:"id"`
	Name      string `json:"name"`
	Type      string `json:"type"`
	Thumbnail []byte `json:"thumbnail"`
}

type StatGazerCloud added in v1.0.6

type StatGazerCloud struct {
	CallsPerSecond float64 `json:"calls_per_second"`
	ReceiveSpeed   float64 `json:"receive_speed"`
	SendSpeed      float64 `json:"send_speed"`
}

type StatGazerNode added in v1.0.6

type StatGazerNode struct {
}

type Statistics

type Statistics struct {
	CloudReceivedBytes int `json:"cloud_received_bytes"`
	CloudSentBytes     int `json:"cloud_sent_bytes"`
	ApiCalls           int `json:"api_calls"`
}

type User added in v1.0.1

type User struct {
	Name         string `json:"name"`
	PasswordHash string `json:"password_hash"`
}

Jump to

Keyboard shortcuts

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