generator

package
v0.12.0 Latest Latest
Warning

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

Go to latest
Published: May 11, 2024 License: MIT Imports: 34 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func NewBinaryArtifactNode added in v0.11.0

func NewBinaryArtifactNode(bytesNode nodes.NodeOutput[[]byte]) nodes.NodeOutput[Artifact]

func NewIOArtifactNode added in v0.11.0

func NewIOArtifactNode(readerNode nodes.NodeOutput[io.Reader]) nodes.NodeOutput[Artifact]

func NewImageArtifactNode added in v0.11.0

func NewImageArtifactNode(imageNode nodes.NodeOutput[image.Image]) nodes.NodeOutput[Artifact]

func NewSplatArtifactNode added in v0.11.0

func NewSplatArtifactNode(meshNode nodes.NodeOutput[modeling.Mesh]) nodes.NodeOutput[Artifact]

func NewTextArtifactNode added in v0.11.0

func NewTextArtifactNode(textNode nodes.NodeOutput[string]) nodes.NodeOutput[Artifact]

func Nodes added in v0.11.0

func Nodes() *refutil.TypeFactory

func WriteMermaid added in v0.10.0

func WriteMermaid(a App, out io.Writer) error

Types

type App added in v0.9.0

type App struct {
	Name        string
	Version     string
	Description string
	WebScene    *room.WebScene
	Authors     []Author
	Producers   map[string]nodes.NodeOutput[Artifact]
	// contains filtered or unexported fields
}

func (*App) ApplyGraph added in v0.11.0

func (a *App) ApplyGraph(jsonPayload []byte) error

func (App) Generate added in v0.10.0

func (a App) Generate(outputPath string) error

func (*App) Graph added in v0.11.0

func (a *App) Graph() []byte

func (*App) Run added in v0.9.0

func (a *App) Run() error

func (*App) Schema added in v0.10.0

func (a *App) Schema() AppSchema

func (*App) SetupProducers added in v0.11.0

func (a *App) SetupProducers()

func (App) WriteZip added in v0.10.0

func (a App) WriteZip(out io.Writer) error

type AppSchema added in v0.10.0

type AppSchema struct {
	Producers map[string]ProducerSchema     `json:"producers"`
	Nodes     map[string]NodeInstanceSchema `json:"nodes"`
	Types     []NodeTypeSchema              `json:"types"`
}

type AppServer added in v0.10.0

type AppServer struct {
	// contains filtered or unexported fields
}

func (*AppServer) ApplyMessage added in v0.11.0

func (as *AppServer) ApplyMessage(key string, msg []byte) (bool, error)

func (*AppServer) GraphEndpoint added in v0.11.0

func (as *AppServer) GraphEndpoint(w http.ResponseWriter, r *http.Request)

func (*AppServer) MermaidEndpoint added in v0.10.0

func (as *AppServer) MermaidEndpoint(w http.ResponseWriter, r *http.Request)

func (*AppServer) NodeConnectionEndpoint added in v0.11.0

func (as *AppServer) NodeConnectionEndpoint(w http.ResponseWriter, r *http.Request)

func (*AppServer) NodeEndpoint added in v0.11.0

func (as *AppServer) NodeEndpoint(w http.ResponseWriter, r *http.Request)

func (*AppServer) ProducerEndpoint added in v0.10.0

func (as *AppServer) ProducerEndpoint(w http.ResponseWriter, r *http.Request)

func (*AppServer) ProfileEndpoint added in v0.10.0

func (as *AppServer) ProfileEndpoint(w http.ResponseWriter, r *http.Request)

func (*AppServer) SceneEndpoint added in v0.10.0

func (as *AppServer) SceneEndpoint(w http.ResponseWriter, r *http.Request)

func (*AppServer) SchemaEndpoint added in v0.10.0

func (as *AppServer) SchemaEndpoint(w http.ResponseWriter, r *http.Request)

func (*AppServer) Serve added in v0.10.0

func (as *AppServer) Serve() error

func (*AppServer) StartedEndpoint added in v0.10.0

func (as *AppServer) StartedEndpoint(w http.ResponseWriter, r *http.Request)

func (*AppServer) ZipEndpoint added in v0.10.0

func (as *AppServer) ZipEndpoint(w http.ResponseWriter, r *http.Request)

type Artifact added in v0.9.0

type Artifact interface {
	Write(io.Writer) error
}

type Author added in v0.9.0

type Author struct {
	Name        string
	ContactInfo []AuthorContact
}

type AuthorContact added in v0.9.0

type AuthorContact struct {
	Medium string
	Value  string
}

type BinaryArtifact added in v0.10.0

type BinaryArtifact struct {
	Data []byte
}

func (BinaryArtifact) Write added in v0.10.0

func (ga BinaryArtifact) Write(w io.Writer) error

type BinaryArtifactNode added in v0.10.0

type BinaryArtifactNode = nodes.StructNode[Artifact, BinaryArtifactNodeData]

type BinaryArtifactNodeData added in v0.11.0

type BinaryArtifactNodeData struct {
	In nodes.NodeOutput[[]byte]
}

func (BinaryArtifactNodeData) Process added in v0.11.0

func (pn BinaryArtifactNodeData) Process() (Artifact, error)

type CliParameterNodeConfig added in v0.10.0

type CliParameterNodeConfig[T any] struct {
	FlagName string `json:"flagName"`
	Usage    string `json:"usage"`
	// contains filtered or unexported fields
}

type CreateNodeConnectionRequest added in v0.11.0

type CreateNodeConnectionRequest struct {
	NodeOutId   string `json:"nodeOutId"`
	OutPortName string `json:"outPortName"`
	NodeInId    string `json:"nodeInId"`
	InPortName  string `json:"inPortName"`
}

type CreateNodeConnectionResponse added in v0.11.0

type CreateNodeConnectionResponse struct {
}

type CreateNodeRequest added in v0.11.0

type CreateNodeRequest struct {
	NodeType string `json:"nodeType"`
}

type CreateNodeResponse added in v0.11.0

type CreateNodeResponse struct {
	NodeID string             `json:"nodeID"`
	Data   NodeInstanceSchema `json:"data"`
}

type CustomGraphSerialization added in v0.11.0

type CustomGraphSerialization interface {
	ToJSON(encoder *jbtf.Encoder) ([]byte, error)
	FromJSON(decoder jbtf.Decoder, body []byte) error
}

type DeleteNodeConnectionRequest added in v0.11.0

type DeleteNodeConnectionRequest struct {
	NodeId     string `json:"nodeId"`
	InPortName string `json:"inPortName"`
}

type DeleteNodeConnectionResponse added in v0.11.0

type DeleteNodeConnectionResponse struct {
}

type DeleteNodeRequest added in v0.11.0

type DeleteNodeRequest struct {
	NodeID string `json:"nodeID"`
}

type GltfArtifact added in v0.9.0

type GltfArtifact struct {
	Scene gltf.PolyformScene
}

func (GltfArtifact) Write added in v0.9.0

func (ga GltfArtifact) Write(w io.Writer) error

type Graph added in v0.11.0

type Graph struct {
	Name        string                       `json:"name,omitempty"`
	Version     string                       `json:"version,omitempty"`
	Description string                       `json:"description,omitempty"`
	WebScene    *room.WebScene               `json:"webScene"`
	Producers   map[string]ProducerSchema    `json:"producers"`
	Nodes       map[string]GraphNodeInstance `json:"nodes"`
}

type GraphNodeInstance added in v0.11.0

type GraphNodeInstance struct {
	Type         string                 `json:"type"`
	Dependencies []NodeDependencySchema `json:"dependencies,omitempty"`
	Data         json.RawMessage        `json:"data,omitempty"`
}

type IOArtifact added in v0.10.0

type IOArtifact struct {
	Reader io.Reader
}

func (IOArtifact) Write added in v0.10.0

func (ga IOArtifact) Write(w io.Writer) error

type IOArtifactNode added in v0.10.0

type IOArtifactNode = nodes.StructNode[Artifact, IOArtifactNodeData]

type IOArtifactNodeData added in v0.11.0

type IOArtifactNodeData struct {
	In nodes.NodeOutput[io.Reader]
}

func (IOArtifactNodeData) Process added in v0.11.0

func (pn IOArtifactNodeData) Process() (Artifact, error)

type ImageArtifact added in v0.9.0

type ImageArtifact struct {
	Image image.Image
}

func (ImageArtifact) Write added in v0.9.0

func (ia ImageArtifact) Write(w io.Writer) error

type ImageArtifactNode added in v0.10.0

type ImageArtifactNode = nodes.StructNode[Artifact, ImageArtifactNodeData]

type ImageArtifactNodeData added in v0.11.0

type ImageArtifactNodeData struct {
	In nodes.NodeOutput[image.Image]
}

func (ImageArtifactNodeData) Process added in v0.11.0

func (pn ImageArtifactNodeData) Process() (Artifact, error)

type ImageNodeOutput added in v0.11.0

type ImageNodeOutput struct {
	Val *ImageParameterNode
}

func (ImageNodeOutput) Node added in v0.11.0

func (sno ImageNodeOutput) Node() nodes.Node

func (ImageNodeOutput) Port added in v0.11.0

func (sno ImageNodeOutput) Port() string

func (ImageNodeOutput) Value added in v0.11.0

func (sno ImageNodeOutput) Value() image.Image

type ImageParameterNode added in v0.11.0

type ImageParameterNode struct {
	Name         string
	DefaultValue image.Image
	CLI          *CliParameterNodeConfig[string]
	// contains filtered or unexported fields
}

func (*ImageParameterNode) AddSubscription added in v0.11.0

func (pn *ImageParameterNode) AddSubscription(a nodes.Alertable)

func (*ImageParameterNode) ApplyMessage added in v0.11.0

func (pn *ImageParameterNode) ApplyMessage(msg []byte) (bool, error)

func (*ImageParameterNode) Dependencies added in v0.11.0

func (pn *ImageParameterNode) Dependencies() []nodes.NodeDependency

func (*ImageParameterNode) DisplayName added in v0.11.0

func (pn *ImageParameterNode) DisplayName() string

func (*ImageParameterNode) FromJSON added in v0.11.0

func (pn *ImageParameterNode) FromJSON(decoder jbtf.Decoder, body []byte) (err error)

func (ImageParameterNode) Inputs added in v0.11.0

func (tn ImageParameterNode) Inputs() []nodes.Input

func (*ImageParameterNode) Node added in v0.11.0

func (in *ImageParameterNode) Node() nodes.Node

func (*ImageParameterNode) Out added in v0.11.0

func (*ImageParameterNode) Outputs added in v0.11.0

func (tn *ImageParameterNode) Outputs() []nodes.Output

func (ImageParameterNode) Port added in v0.11.0

func (in ImageParameterNode) Port() string

func (*ImageParameterNode) Schema added in v0.11.0

func (pn *ImageParameterNode) Schema() ParameterSchema

func (ImageParameterNode) SetInput added in v0.11.0

func (vn ImageParameterNode) SetInput(input string, output nodes.Output)

func (*ImageParameterNode) State added in v0.11.0

func (pn *ImageParameterNode) State() nodes.NodeState

func (*ImageParameterNode) ToJSON added in v0.11.0

func (pn *ImageParameterNode) ToJSON(encoder *jbtf.Encoder) ([]byte, error)

func (*ImageParameterNode) ToMessage added in v0.11.0

func (pn *ImageParameterNode) ToMessage() []byte

func (*ImageParameterNode) Value added in v0.11.0

func (pn *ImageParameterNode) Value() image.Image

func (ImageParameterNode) Version added in v0.11.0

func (pn ImageParameterNode) Version() int

type NodeBuilder added in v0.11.0

type NodeBuilder func() nodes.Node

type NodeDependencySchema added in v0.10.0

type NodeDependencySchema struct {
	DependencyID   string `json:"dependencyID"`
	DependencyPort string `json:"dependencyPort"`
	Name           string `json:"name"`
}

type NodeInput added in v0.11.0

type NodeInput struct {
	Type string `json:"type"`
}

type NodeInstanceSchema added in v0.11.0

type NodeInstanceSchema struct {
	Type         string                 `json:"type"`
	Name         string                 `json:"name"`
	Version      int                    `json:"version"`
	Dependencies []NodeDependencySchema `json:"dependencies"`
	Parameter    ParameterSchema        `json:"parameter,omitempty"`
	// contains filtered or unexported fields
}

type NodeOutput added in v0.10.0

type NodeOutput struct {
	Name string `json:"name"`
	Type string `json:"type"`
}

type NodeTypeSchema added in v0.11.0

type NodeTypeSchema struct {
	DisplayName string               `json:"displayName"`
	Type        string               `json:"type"`
	Path        string               `json:"path"`
	Outputs     []NodeOutput         `json:"outputs,omitempty"`
	Inputs      map[string]NodeInput `json:"inputs,omitempty"`
	Parameter   ParameterSchema      `json:"parameter,omitempty"`
}

func BuildNodeTypeSchema added in v0.11.0

func BuildNodeTypeSchema(node nodes.Node) NodeTypeSchema

type Parameter

type Parameter interface {
	DisplayName() string
	Schema() ParameterSchema

	ApplyMessage(msg []byte) (bool, error)
	ToMessage() []byte
	// contains filtered or unexported methods
}

type ParameterNode added in v0.10.0

type ParameterNode[T any] struct {
	Name         string                     `json:"name"`
	DefaultValue T                          `json:"defaultValue"`
	CLI          *CliParameterNodeConfig[T] `json:"cli"`
	// contains filtered or unexported fields
}

func (*ParameterNode[T]) AddSubscription added in v0.10.0

func (pn *ParameterNode[T]) AddSubscription(a nodes.Alertable)

func (*ParameterNode[T]) ApplyMessage added in v0.11.0

func (pn *ParameterNode[T]) ApplyMessage(msg []byte) (bool, error)

func (*ParameterNode[T]) Dependencies added in v0.10.0

func (pn *ParameterNode[T]) Dependencies() []nodes.NodeDependency

func (*ParameterNode[T]) DisplayName added in v0.10.0

func (pn *ParameterNode[T]) DisplayName() string

func (*ParameterNode[T]) FromJSON added in v0.11.0

func (pn *ParameterNode[T]) FromJSON(decoder jbtf.Decoder, body []byte) (err error)

func (ParameterNode[T]) Inputs added in v0.11.0

func (tn ParameterNode[T]) Inputs() []nodes.Input

func (*ParameterNode[T]) Node added in v0.10.0

func (in *ParameterNode[T]) Node() nodes.Node

func (*ParameterNode[T]) Out added in v0.11.0

func (tn *ParameterNode[T]) Out() nodes.NodeOutput[T]

func (*ParameterNode[T]) Outputs added in v0.11.0

func (tn *ParameterNode[T]) Outputs() []nodes.Output

func (*ParameterNode[T]) Port added in v0.11.0

func (in *ParameterNode[T]) Port() string

func (*ParameterNode[T]) Schema added in v0.10.0

func (pn *ParameterNode[T]) Schema() ParameterSchema

func (ParameterNode[T]) SetInput added in v0.11.0

func (vn ParameterNode[T]) SetInput(input string, output nodes.Output)

func (*ParameterNode[T]) State added in v0.10.0

func (pn *ParameterNode[T]) State() nodes.NodeState

func (*ParameterNode[T]) ToJSON added in v0.11.0

func (pn *ParameterNode[T]) ToJSON(encoder *jbtf.Encoder) ([]byte, error)

func (ParameterNode[T]) ToMessage added in v0.11.0

func (pn ParameterNode[T]) ToMessage() []byte

func (*ParameterNode[T]) Value added in v0.11.0

func (pn *ParameterNode[T]) Value() T

func (ParameterNode[T]) Version added in v0.10.0

func (pn ParameterNode[T]) Version() int

type ParameterNodeOutput added in v0.11.0

type ParameterNodeOutput[T any] struct {
	Val *ParameterNode[T]
}

func (ParameterNodeOutput[T]) Node added in v0.11.0

func (sno ParameterNodeOutput[T]) Node() nodes.Node

func (ParameterNodeOutput[T]) Port added in v0.11.0

func (sno ParameterNodeOutput[T]) Port() string

func (ParameterNodeOutput[T]) Value added in v0.11.0

func (sno ParameterNodeOutput[T]) Value() T

type ParameterNodeSchema added in v0.10.0

type ParameterNodeSchema[T any] struct {
	ParameterSchemaBase
	DefaultValue T `json:"defaultValue"`
	CurrentValue T `json:"currentValue"`
}

type ParameterSchema added in v0.9.0

type ParameterSchema interface {
	ValueType() string
	DisplayName() string
}

type ParameterSchemaBase added in v0.9.0

type ParameterSchemaBase struct {
	Name string `json:"name"`
	Type string `json:"type"`
}

func (ParameterSchemaBase) DisplayName added in v0.9.0

func (gps ParameterSchemaBase) DisplayName() string

func (ParameterSchemaBase) ValueType added in v0.9.0

func (gps ParameterSchemaBase) ValueType() string

type PolyformArtifact added in v0.9.0

type PolyformArtifact[T any] interface {
	Artifact
	Value() T
}

type ProducerSchema added in v0.11.0

type ProducerSchema struct {
	NodeID string `json:"nodeID"`
	Port   string `json:"port"` // Name of node out port
}

type SplatArtifact added in v0.10.0

type SplatArtifact struct {
	Mesh modeling.Mesh
}

func (SplatArtifact) Write added in v0.10.0

func (sa SplatArtifact) Write(w io.Writer) error

type SplatArtifactNode added in v0.10.0

type SplatArtifactNode = nodes.StructNode[Artifact, SplatArtifactNodeData]

type SplatArtifactNodeData added in v0.11.0

type SplatArtifactNodeData struct {
	In nodes.NodeOutput[modeling.Mesh]
}

func (SplatArtifactNodeData) Process added in v0.11.0

func (pn SplatArtifactNodeData) Process() (Artifact, error)

type TextArtifact added in v0.11.0

type TextArtifact struct {
	Data string
}

func (TextArtifact) Write added in v0.11.0

func (ga TextArtifact) Write(w io.Writer) error

type TextArtifactNode added in v0.11.0

type TextArtifactNode = nodes.StructNode[Artifact, TextArtifactNodeData]

type TextArtifactNodeData added in v0.11.0

type TextArtifactNodeData struct {
	In nodes.NodeOutput[string]
}

func (TextArtifactNodeData) Process added in v0.11.0

func (pn TextArtifactNodeData) Process() (Artifact, error)

Directories

Path Synopsis

Jump to

Keyboard shortcuts

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