Documentation
¶
Index ¶
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
This section is empty.
Types ¶
type ApiFlow ¶
type ApiFlow struct {
// contains filtered or unexported fields
}
ApiFlow wraps a dependency tree to provide API execution logic
func NewApiFlow ¶
NewApiFlow creates a new ApiFlow instance
type DependencyTree ¶
type DependencyTree struct {
// contains filtered or unexported fields
}
DependencyTree represents the entire tree structure
func NewDependencyTree ¶
func NewDependencyTree() *DependencyTree
NewDependencyTree creates a new, empty dependency tree
func (*DependencyTree) AddNode ¶
func (dt *DependencyTree) AddNode(node *Node, upstreamIDs []string)
AddNode adds a pre-created node to the dependency tree with its upstream dependencies
type Handler ¶
type Handler func(ctx context.Context, node *Node, inputs map[string]interface{}) (interface{}, error)
Handler is a function associated with a node type It will be executed during traversal or as needed Returns an error to indicate failure
type Node ¶
type Node struct {
ID string // Unique identifier of the node
Predecessors map[string]*Node // Nodes that are dependencies of this node
Successors map[string]*Node // Nodes that depend on this node
Handler Handler // Handler function associated with the node
State string // "pending", "success", "failure"
Data interface{} // Data produced by this node
Mutex sync.Mutex // To protect state and data modifications
}
Click to show internal directories.
Click to hide internal directories.