productconfig

package
v0.9.0 Latest Latest
Warning

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

Go to latest
Published: Dec 15, 2015 License: MIT Imports: 5 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type CommandOrEventParam

type CommandOrEventParam struct {
	ValueType int32 `json:"value_type"`
	Name      string
}

type ProductCommandOrEvent

type ProductCommandOrEvent struct {
	No       int
	Part     int
	Name     string
	Priority int
	Params   []CommandOrEventParam
}

type ProductConfig

type ProductConfig struct {
	Objects  []ProductObject
	Commands []ProductCommandOrEvent
	Events   []ProductCommandOrEvent
}

product config parses the JSON product config string.

func New

func New(config string) (*ProductConfig, error)

func (*ProductConfig) MapToStatus

func (config *ProductConfig) MapToStatus(data map[string]interface{}) ([]protocol.SubData, error)

func (*ProductConfig) StatusToMap

func (config *ProductConfig) StatusToMap(status []protocol.SubData) (map[string][]interface{}, error)

func (*ProductConfig) ValidateStatus

func (config *ProductConfig) ValidateStatus(label string, params []interface{}) (*ProductObject, []interface{}, error)

type ProductObject

type ProductObject struct {
	Id     int
	No     int
	Label  string
	Part   int
	Status []StatusParam
}

type StatusParam

type StatusParam struct {
	ValueType int32 `json:"value_type"`
	Name      string
}

Jump to

Keyboard shortcuts

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