marshaller

package
v0.0.13 Latest Latest
Warning

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

Go to latest
Published: Mar 14, 2024 License: Apache-2.0 Imports: 13 Imported by: 3

Documentation

Index

Constants

This section is empty.

Variables

View Source
var ErrCharacteristicNotFoundInService = errors.New("characteristic not in service")
View Source
var ErrorNoMatchFound = errors.New("no match found")

Functions

func RemoveVoidVariables

func RemoveVoidVariables(contents []model.Content) (result []model.Content)

func UsePathAllowList

func UsePathAllowList(contents []model.Content, pathAllowList []string) (result []model.Content)

Types

type CharacteristicId

type CharacteristicId = string

type CharacteristicsPathResponse

type CharacteristicsPathResponse struct {
	Path                    string `json:"path"`
	ServiceCharacteristicId string `json:"service_characteristic_id"`
}

type ConceptId

type ConceptId = string

type ConceptRepo

type ConceptRepo interface {
	GetConceptsOfCharacteristic(characteristicId string) (conceptIds []string, err error)
	GetCharacteristic(id CharacteristicId) (model.Characteristic, error)
	GetRootCharacteristics(ids []CharacteristicId) (result []CharacteristicId)
	GetCharacteristicsOfFunction(functionId string) (characteristicIds []string, err error)
}

type Converter

type Converter interface {
	Cast(in interface{}, from CharacteristicId, to CharacteristicId) (out interface{}, err error)
}

type DeviceRepository

type DeviceRepository interface {
	GetDeviceType(id string) (result model.DeviceType, err error, code int)
	GetAspectNode(id string) (result model.AspectNode, err error)
}

type Marshaller

type Marshaller struct {
	ConceptRepo ConceptRepo
	// contains filtered or unexported fields
}

func New

func New(converter Converter, concepts ConceptRepo, devicerepo DeviceRepository) *Marshaller

func (*Marshaller) GetPathOption

func (this *Marshaller) GetPathOption(deviceTypeIds []string, functionId string, aspectId string, characteristicIdFilter []string, withEnvelope bool) (result map[string][]PathOptionsResultElement, err error, code int)

func (*Marshaller) GetServiceCharacteristicPath

func (this *Marshaller) GetServiceCharacteristicPath(service model.Service, characteristicId string) (result CharacteristicsPathResponse, err error, code int)

func (*Marshaller) MarshalInput

func (this *Marshaller) MarshalInput(partial mapping.Partial, inputCharacteristicValue interface{}, inputCharacteristic model.Characteristic, serviceCharacteristic model.Characteristic, serviceVariable model.ContentVariable, serializationId models.Serialization) (result string, err error)

func (*Marshaller) MarshalInputs

func (this *Marshaller) MarshalInputs(protocol model.Protocol, service model.Service, input interface{}, inputCharacteristicId CharacteristicId, pathAllowList []string, configurables ...configurables.Configurable) (result map[string]string, err error)

func (*Marshaller) UnmarshalOutputs

func (this *Marshaller) UnmarshalOutputs(protocol model.Protocol, service model.Service, outputMap map[string]string, outputCharacteristicId CharacteristicId, pathAllowList []string, hints ...string) (result interface{}, err error)

type PathOptionsResultElement

type PathOptionsResultElement struct {
	ServiceId              string            `json:"service_id"`
	JsonPath               []string          `json:"json_path"`
	PathToCharacteristicId map[string]string `json:"path_to_characteristic_id"`
}

Directories

Path Synopsis
xml

Jump to

Keyboard shortcuts

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