graph

package
v0.39.0 Latest Latest
Warning

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

Go to latest
Published: Jul 14, 2026 License: MIT Imports: 21 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func BuildNodeTypeSchema

func BuildNodeTypeSchema(registeredType string, node nodes.Node) schema.NodeType

func ForeachManifestNodeOutput added in v0.32.0

func ForeachManifestNodeOutput(i *Instance, f func(nodeId string, node nodes.Node, output nodes.Output[manifest.Manifest]) error) error

func RecurseDependenciesType

func RecurseDependenciesType[T any](dependent nodes.Node) []T

func SwaggerSpec added in v0.32.0

func SwaggerSpec(instance *Instance) swagger.Spec

func WriteManifestToZip added in v0.32.0

func WriteManifestToZip(i *Instance, zw *zip.Writer, nodeId string, node nodes.Node, out nodes.Output[manifest.Manifest]) error

func WriteMermaid added in v0.32.0

func WriteMermaid(a *Instance, out io.Writer) error

func WriteOutline added in v0.32.0

func WriteOutline(graph *Instance, out io.Writer) error

func WriteSwagger added in v0.32.0

func WriteSwagger(instance *Instance, out io.Writer) error

func WriteToFolder added in v0.32.0

func WriteToFolder(i *Instance, folder string) error

func WriteToZip added in v0.32.0

func WriteToZip(i *Instance, zw *zip.Writer) error

Types

type BoundaryPortKind added in v0.39.0

type BoundaryPortKind string
const (
	BoundaryPortKindInput  BoundaryPortKind = "input"
	BoundaryPortKindOutput BoundaryPortKind = "output"
)

func GetBoundaryKind added in v0.39.0

func GetBoundaryKind(boundary subgraph.Boundary) BoundaryPortKind

type Config added in v0.32.0

type Config struct {
	Name            string
	Version         string
	Description     string
	Authors         []persistence.Author
	TypeFactory     *refutil.TypeFactory
	VariableFactory func(string) (variable.Variable, error)
}

type CustomGraphSerialization

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

type Details added in v0.32.0

type Details struct {
	Name        string
	Version     string
	Description string
	Authors     []persistence.Author
}

type Instance

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

func New

func New(config Config) *Instance

func (*Instance) AddProducer

func (a *Instance) AddProducer(producerName string, producer nodes.Output[manifest.Manifest])

func (*Instance) ApplyAppSchema

func (a *Instance) ApplyAppSchema(jsonPayload []byte) error

func (*Instance) ApplyProfile added in v0.32.0

func (a *Instance) ApplyProfile(profile variable.Profile) error

func (*Instance) BuildSchemaForAllNodeTypes added in v0.32.0

func (i *Instance) BuildSchemaForAllNodeTypes() []schema.NodeType

func (*Instance) CollectBoundaryPorts added in v0.39.0

func (a *Instance) CollectBoundaryPorts(subGraphID string) ([]SubgraphBoundaryPort, error)

func (*Instance) ConnectNodes

func (a *Instance) ConnectNodes(nodeOutId, outPortName, nodeInId, inPortName string)

func (*Instance) CreateBoundaryNode added in v0.39.0

func (a *Instance) CreateBoundaryNode(nodeType, portType string) (nodes.Node, string, error)

CreateBoundaryNode instantiates a subgraph boundary node with a given port type.

func (*Instance) CreateNode

func (a *Instance) CreateNode(nodeType string) (nodes.Node, string, error)

func (*Instance) CreateSubGraph added in v0.39.0

func (a *Instance) CreateSubGraph(id, name, description string) error

func (*Instance) DeleteMetadata

func (a *Instance) DeleteMetadata(key string)

func (*Instance) DeleteNode

func (a *Instance) DeleteNode(nodeToDelete nodes.Node)

func (*Instance) DeleteNodeById added in v0.28.0

func (a *Instance) DeleteNodeById(nodeId string)

func (*Instance) DeleteNodeInputConnection

func (a *Instance) DeleteNodeInputConnection(nodeId, portName string)

func (*Instance) DeleteProfile added in v0.31.0

func (a *Instance) DeleteProfile(profileName string) error

func (*Instance) DeleteSubGraph added in v0.39.0

func (a *Instance) DeleteSubGraph(id string) error

func (*Instance) DeleteVariable added in v0.28.0

func (a *Instance) DeleteVariable(variablePath string)

func (*Instance) EncodeToAppSchema

func (a *Instance) EncodeToAppSchema() ([]byte, error)

func (*Instance) ExecutionReport added in v0.32.0

func (a *Instance) ExecutionReport() schema.GraphExecutionReport

func (*Instance) GetAuthors added in v0.32.0

func (a *Instance) GetAuthors() []persistence.Author

func (*Instance) GetDescription added in v0.32.0

func (a *Instance) GetDescription() string

func (*Instance) GetName added in v0.32.0

func (a *Instance) GetName() string

func (*Instance) GetVariable added in v0.28.0

func (a *Instance) GetVariable(variablePath string) variable.Variable

func (*Instance) GetVersion added in v0.32.0

func (a *Instance) GetVersion() string

func (*Instance) HasNodeWithId added in v0.27.0

func (a *Instance) HasNodeWithId(nodeId string) bool

func (*Instance) IsPortNamed added in v0.25.0

func (a *Instance) IsPortNamed(node nodes.Node, portName string) (string, bool)

func (*Instance) IsRoot added in v0.39.0

func (a *Instance) IsRoot() bool

func (*Instance) IsSubGraphScope added in v0.39.0

func (a *Instance) IsSubGraphScope() bool

func (*Instance) LoadProfile added in v0.31.0

func (a *Instance) LoadProfile(profileName string) error

func (*Instance) Manifest added in v0.25.0

func (a *Instance) Manifest(producerName string) manifest.Manifest

func (*Instance) ModelVersion

func (a *Instance) ModelVersion() uint32

func (*Instance) NewVariable added in v0.28.0

func (a *Instance) NewVariable(variablePath string, variable variable.Variable) string

>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>> VARIABLES >>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>

func (*Instance) Node

func (a *Instance) Node(nodeId string) nodes.Node

func (*Instance) NodeId

func (a *Instance) NodeId(node nodes.Node) string

func (*Instance) NodeIds added in v0.25.0

func (a *Instance) NodeIds() []string

func (*Instance) NodeInstanceSchema

func (a *Instance) NodeInstanceSchema(node nodes.Node) schema.Node

func (*Instance) Parameter

func (a *Instance) Parameter(nodeId string) Parameter

func (*Instance) ParameterData

func (a *Instance) ParameterData(nodeId string) []byte

func (*Instance) Producer

func (a *Instance) Producer(producerName string) nodes.Output[manifest.Manifest]

func (*Instance) ProducerNames

func (a *Instance) ProducerNames() []string

func (*Instance) Profiles added in v0.31.0

func (a *Instance) Profiles() []string

func (*Instance) RegisterSubGraphNodeType added in v0.39.0

func (a *Instance) RegisterSubGraphNodeType(subGraphID string) (string, error)

func (*Instance) RenameProfile added in v0.31.0

func (a *Instance) RenameProfile(profile, newName string) error

func (*Instance) Reset added in v0.22.2

func (a *Instance) Reset()

func (*Instance) Root added in v0.39.0

func (a *Instance) Root() *Instance

func (*Instance) SaveProfile added in v0.31.0

func (a *Instance) SaveProfile(profileName string)

func (*Instance) Schema

func (a *Instance) Schema() schema.Graph

func (*Instance) SetBoundaryNodeInfo added in v0.39.0

func (a *Instance) SetBoundaryNodeInfo(nodeID, portName string) error

func (*Instance) SetDescription added in v0.32.0

func (a *Instance) SetDescription(description string)

func (*Instance) SetDetails added in v0.32.0

func (a *Instance) SetDetails(details Details)

func (*Instance) SetMetadata

func (a *Instance) SetMetadata(key string, value any)

func (*Instance) SetName added in v0.32.0

func (a *Instance) SetName(name string)

func (*Instance) SetNodeAsProducer

func (a *Instance) SetNodeAsProducer(nodeId, nodePort, producerName string)

func (*Instance) SetSubGraphInfo added in v0.39.0

func (a *Instance) SetSubGraphInfo(id, name, description string) error

func (*Instance) SetVariableDescription added in v0.28.0

func (a *Instance) SetVariableDescription(variablePath, description string) error

func (*Instance) SetVariableInfo added in v0.28.0

func (a *Instance) SetVariableInfo(variablePath, newPath, description string) error

func (*Instance) SetVersion added in v0.32.0

func (a *Instance) SetVersion(version string)

func (*Instance) SubGraphInstance added in v0.39.0

func (a *Instance) SubGraphInstance(id string) (*Instance, error)

func (*Instance) SubGraphScopeID added in v0.39.0

func (a *Instance) SubGraphScopeID() string

func (*Instance) SwaggerDefinition added in v0.32.0

func (a *Instance) SwaggerDefinition() swagger.Definition

func (*Instance) UpdateParameter

func (a *Instance) UpdateParameter(nodeId string, data []byte) (bool, error)

func (*Instance) UpdateVariable added in v0.28.0

func (a *Instance) UpdateVariable(variablePath string, data []byte) (bool, error)

func (*Instance) VariableData added in v0.28.0

func (a *Instance) VariableData(variablePath string) ([]byte, error)

type Parameter

type Parameter interface {
	DisplayName() string
	Schema() schema.Parameter

	SetName(name string)
	SetDescription(name string)

	ApplyMessage(msg []byte) (bool, error)
	ToMessage() []byte
}

type Scope added in v0.39.0

type Scope string
const RootScope Scope = "root"

func SubGraphScope added in v0.39.0

func SubGraphScope(subGraphID string) Scope

func (Scope) IsRoot added in v0.39.0

func (s Scope) IsRoot() bool

func (Scope) ResolveInstance added in v0.39.0

func (s Scope) ResolveInstance(graph *Instance) (*Instance, error)

func (Scope) String added in v0.39.0

func (s Scope) String() string

func (Scope) SubGraphID added in v0.39.0

func (s Scope) SubGraphID() (string, error)

type SubgraphBoundaryPort added in v0.39.0

type SubgraphBoundaryPort struct {
	Name string
	Type string
	Kind BoundaryPortKind
}

type SubgraphInstanceNode added in v0.39.0

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

SubgraphInstanceNode is a placement of a sub-graph on a parent graph. Each placement owns a private clone of the definition so evaluation is isolated, while edits to the shared definition rebuild every clone.

func NewRuntimeNode added in v0.39.0

func NewRuntimeNode(owner *Instance, subGraphID string) *SubgraphInstanceNode

func (*SubgraphInstanceNode) Description added in v0.39.0

func (r *SubgraphInstanceNode) Description() string

func (*SubgraphInstanceNode) Inputs added in v0.39.0

func (r *SubgraphInstanceNode) Inputs() map[string]nodes.InputPort

func (*SubgraphInstanceNode) Name added in v0.39.0

func (r *SubgraphInstanceNode) Name() string

func (*SubgraphInstanceNode) Outputs added in v0.39.0

func (r *SubgraphInstanceNode) Outputs() map[string]nodes.OutputPort

func (*SubgraphInstanceNode) Path added in v0.39.0

func (r *SubgraphInstanceNode) Path() string

func (*SubgraphInstanceNode) SubGraphID added in v0.39.0

func (r *SubgraphInstanceNode) SubGraphID() string

Jump to

Keyboard shortcuts

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