apigraph

package
v0.0.0-...-1b97063 Latest Latest
Warning

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

Go to latest
Published: Jun 21, 2024 License: MIT Imports: 6 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func Marshal

func Marshal(g *Graph) ([]byte, error)

func Write

func Write(w io.Writer, g *Graph) error

func WriteFile

func WriteFile(path string, g *Graph) error

Types

type Bool

type Bool bool

type Float

type Float float64

type Graph

type Graph struct {
	LastID types.NodeID
	Nodes  map[types.NodeID]*Node
}

func New

func New() *Graph

func Read

func Read(r io.Reader) (*Graph, error)

func ReadFile

func ReadFile(path string) (*Graph, error)

func Unmarshal

func Unmarshal(data []byte) (*Graph, error)

func (*Graph) Add

func (g *Graph) Add(n *Node) types.NodeID

func (Graph) MarshalJSON

func (g Graph) MarshalJSON() ([]byte, error)

type Int

type Int int64
type Link struct {
	NodeID  types.NodeID
	OutPort int
}

func (Link) MarshalJSON

func (l Link) MarshalJSON() ([]byte, error)

func (*Link) UnmarshalJSON

func (l *Link) UnmarshalJSON(data []byte) error

type Meta

type Meta struct {
	Title string `json:"title,omitempty"`
}

type Node

type Node struct {
	ID     types.NodeID     `json:"-"`
	Class  types.NodeClass  `json:"class_type"`
	Inputs map[string]Value `json:"inputs,omitempty"`
	Meta   json.RawMessage  `json:"_meta,omitempty"`
}

type String

type String string

type Value

type Value interface {
	// contains filtered or unexported methods
}

Jump to

Keyboard shortcuts

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