units_system

package
v1.0.0 Latest Latest
Warning

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

Go to latest
Published: Feb 24, 2021 License: MIT Imports: 24 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type UnitType

type UnitType struct {
	TypeCode    string `json:"type_code"`
	Category    string `json:"category"`
	DisplayName string `json:"display_name"`
	Help        string `json:"help"`
	Description string `json:"description"`
	Picture     []byte `json:"picture"`
	ConfigMeta  string `json:"config_meta"`

	Constructor func() common_interfaces.IUnit
}

type UnitsSystem

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

func New

func New(iDataStorage common_interfaces.IDataStorage) *UnitsSystem

func (*UnitsSystem) AddUnit

func (c *UnitsSystem) AddUnit(unitType string, unitId string, name string, config string) error

func (*UnitsSystem) GetConfig

func (c *UnitsSystem) GetConfig(unitId string) (string, string, string, string, error)

func (*UnitsSystem) GetConfigByType

func (c *UnitsSystem) GetConfigByType(unitType string) (string, string, error)

func (*UnitsSystem) GetUnitName

func (c *UnitsSystem) GetUnitName(unitId string) (string, error)

func (*UnitsSystem) GetUnitState

func (c *UnitsSystem) GetUnitState(unitId string) (nodeinterface.UnitStateResponse, error)

func (*UnitsSystem) ListOfUnits

func (c *UnitsSystem) ListOfUnits() nodeinterface.UnitListResponse

func (*UnitsSystem) MakeUnitByType

func (c *UnitsSystem) MakeUnitByType(unitType string, dataStorage common_interfaces.IDataStorage) common_interfaces.IUnit

func (*UnitsSystem) RegisterUnit

func (c *UnitsSystem) RegisterUnit(typeName string, category string, displayName string, constructor func() common_interfaces.IUnit, imgBytes []byte, description string) *UnitType

func (*UnitsSystem) RemoveUnits

func (c *UnitsSystem) RemoveUnits(units []string) error

func (*UnitsSystem) SetConfig

func (c *UnitsSystem) SetConfig(unitId string, name string, config string) error

func (*UnitsSystem) Start

func (c *UnitsSystem) Start()

func (*UnitsSystem) StartUnit

func (c *UnitsSystem) StartUnit(unitId string) error

func (*UnitsSystem) Stop

func (c *UnitsSystem) Stop()

func (*UnitsSystem) StopUnit

func (c *UnitsSystem) StopUnit(unitId string) error

func (*UnitsSystem) UnitCategories

func (*UnitsSystem) UnitTypeForDisplayByType

func (c *UnitsSystem) UnitTypeForDisplayByType(t string) string

func (*UnitsSystem) UnitTypes

func (*UnitsSystem) Units

func (c *UnitsSystem) Units() []units_common.UnitInfo

Jump to

Keyboard shortcuts

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