ember

package
v1.0.12 Latest Latest
Warning

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

Go to latest
Published: Jan 9, 2026 License: AGPL-3.0 Imports: 8 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

View Source
var ErrElementNotFound = errors.New("element not found")

ErrElementNotFound error when element is not found.

Functions

func GetRequestByType

func GetRequestByType(et ElementType, path string) ([]byte, error)

GetRequestByType returns S101 packet with an encoded request for element with the provided type and path.

func GetRootRequest

func GetRootRequest() ([]byte, error)

GetRootRequest returns a S101 request packet with an encoded request for root collection.

Types

type Element

type Element struct {
	Path        string
	ElementType ElementType
	Identifier  string
	Description string
	Children    []*Element
	IsOnline    bool
	IsRoot      bool
	Maximum     any
	Minimum     any
	Value       any
	Access      int
	Format      string
	Enumeration string
	Factor      int
	Default     any
	ValueType   int
}

Element contains all the values a glow element might contain.

func (*Element) ToString

func (el *Element) ToString() string

type ElementCollection

type ElementCollection map[ElementKey]*Element

ElementCollection contains one level of elements and their Ids as key.

func NewElementConnection

func NewElementConnection() ElementCollection

NewElementConnection creates a empty element collection.

func (ElementCollection) GetElementByID

func (ec ElementCollection) GetElementByID(id string) (*Element, string, error)

GetElementByID returns element from collection with the provided identifier.

func (ElementCollection) GetElementByPath

func (ec ElementCollection) GetElementByPath(currentPath string) (*Element, error)

GetElementByPath returns element from collection with the provided path OID.

func (ElementCollection) MarshalJSON

func (ec ElementCollection) MarshalJSON() ([]byte, error)

MarshalJSON returns the collection with path(string) in key value instead of a structure for json marshaling.

func (ElementCollection) Populate

func (ec ElementCollection) Populate(data *asn1.Decoder) error

Populate fills in collection with data from the decoder.

type ElementKey

type ElementKey struct {
	ID   string
	Path string
}

ElementKey used for element identification based on either element id or path.

type ElementType

type ElementType string

ElementType wrapper for string to define available element types.

Jump to

Keyboard shortcuts

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