ir

package
v0.27.0 Latest Latest
Warning

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

Go to latest
Published: Nov 21, 2024 License: MIT Imports: 1 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type FuncCall

type FuncCall struct {
	Ref string   `json:"ref,omitempty"` // Reference to the function in registry.
	IO  FuncIO   `json:"io,omitempty"`  // Input/output ports of the function.
	Msg *Message `json:"msg,omitempty"` // Optional initialization message.
}

FuncCall describes call of a runtime function.

type FuncIO

type FuncIO struct {
	In  []PortAddr `json:"in,omitempty"`  // Must be ordered by path -> port -> idx.
	Out []PortAddr `json:"out,omitempty"` // Must be ordered by path -> port -> idx.
}

FuncIO is how a runtime function gets access to its ports.

type Message

type Message struct {
	Type         MsgType            `json:"-"`
	Bool         bool               `json:"bool,omitempty"`
	Int          int64              `json:"int,omitempty"`
	Float        float64            `json:"float,omitempty"`
	String       string             `json:"str,omitempty"`
	List         []Message          `json:"list,omitempty"`
	DictOrStruct map[string]Message `json:"map,omitempty"`
}

Message is a data that can be sent and received.

type MsgType

type MsgType string

MsgType is an enumeration of message types.

const (
	MsgTypeBool   MsgType = "bool"
	MsgTypeInt    MsgType = "int"
	MsgTypeFloat  MsgType = "float"
	MsgTypeString MsgType = "string"
	MsgTypeList   MsgType = "list"
	MsgTypeDict   MsgType = "dict"
	MsgTypeStruct MsgType = "struct"
)

type PortAddr

type PortAddr struct {
	Path    string `json:"path,omitempty"`    // List of upstream nodes including the owner of the port.
	Port    string `json:"port,omitempty"`    // Name of the port.
	Idx     uint8  `json:"idx,omitempty"`     // Optional index of a slot in array port.
	IsArray bool   `json:"isArray,omitempty"` // Flag to indicate that the port is an array.
}

PortAddr is a composite unique identifier for a port.

func (PortAddr) String added in v0.26.0

func (p PortAddr) String() string

type Program

type Program struct {
	Connections map[PortAddr]PortAddr `json:"connections,omitempty"`
	Funcs       []FuncCall            `json:"funcs,omitempty"`
}

Program is a graph where ports are vertexes and connections are edges.

Jump to

Keyboard shortcuts

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