encoding

package
v0.3.2 Latest Latest
Warning

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

Go to latest
Published: Jul 22, 2025 License: Apache-2.0 Imports: 9 Imported by: 0

Documentation

Overview

Package encoding encodes GX structure

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func IsValue

func IsValue(typ ir.Type) bool

IsValue returns true if the field is a value that can be set, as opposed to a composite structure that needs to be filled recursively.

func Unmarshal

func Unmarshal(bProc BridgeProcessor, target types.Bridger, data Data) (err error)

Unmarshal populates a GX structure from a Go map.

Types

type BridgeProcessor

type BridgeProcessor func(types.ArrayBridge) (types.ArrayBridge, error)

BridgeProcessor processes a bridge instance once it has been loaded.

func SendToDevice

func SendToDevice(dev *api.Device) BridgeProcessor

SendToDevice returns a bridge processor to send arrays to the device when they are loaded.

type Data

type Data interface {
	// ToDataSlice returns a slice view on the serialized data.
	ToDataSlice() (DataSlice, error)

	// ToDataStruct returns a struct view on the serialized data.
	ToDataStruct() (DataStruct, error)

	// ValueFuture able to return data once it has been loaded.
	ValueFuture() (ValueFuture, error)
}

Data is a generic kind of data.

type DataSlice

type DataSlice interface {
	Index(int) (Data, error)
	Len() int
}

DataSlice is serialized data of a slice.

type DataStruct

type DataStruct interface {
	Field(name string) (Data, error)

	TagName() string
}

DataStruct is serialized data of a struct.

type ValueFuture

type ValueFuture interface {
	Value() (types.ArrayBridge, error)
}

ValueFuture is a proxy to a concrete value being loaded perhaps in the background.

Directories

Path Synopsis
Package native fills a GX from Go maps.
Package native fills a GX from Go maps.

Jump to

Keyboard shortcuts

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