Documentation
¶
Index ¶
- type Command
- type EdgeKind
- type EdgeSnapshot
- type Interrupt
- type NodeFunc
- type NodeKind
- type NodeSnapshot
- type NodeSpec
- type Predicate
- type ReachableOption
- type RouteBuilder
- type RouteSelection
- type Snapshot
- type StateGraph
- func (g *StateGraph[S]) Edge(from string, to string) *StateGraph[S]
- func (g *StateGraph[S]) Finish(ids ...string) *StateGraph[S]
- func (g *StateGraph[S]) FixedTargets(id string) []string
- func (g *StateGraph[S]) Flow(ids ...string) *StateGraph[S]
- func (g *StateGraph[S]) HasNode(id string) bool
- func (g *StateGraph[S]) IsFinish(id string) bool
- func (g *StateGraph[S]) Node(spec NodeSpec[S]) *StateGraph[S]
- func (g *StateGraph[S]) NodeFunc(id string) (NodeFunc[S], bool)
- func (g *StateGraph[S]) Reachable(from string, to string, opts ...ReachableOption) *StateGraph[S]
- func (g *StateGraph[S]) Route(from string) *RouteBuilder[S]
- func (g *StateGraph[S]) SelectRoute(ctx context.Context, from string, state S) (RouteSelection, bool, error)
- func (g *StateGraph[S]) Snapshot() Snapshot
- func (g *StateGraph[S]) Start(id string) *StateGraph[S]
- func (g *StateGraph[S]) StartNode() string
- func (g *StateGraph[S]) Step(id string, fn NodeFunc[S]) *StateGraph[S]
- func (g *StateGraph[S]) Validate() error
- func (g *StateGraph[S]) WorkflowID() string
- type Workflow
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
This section is empty.
Types ¶
type Command ¶
func UpdateAndGoto ¶
type EdgeSnapshot ¶
type NodeSnapshot ¶
type ReachableOption ¶
type ReachableOption func(*dynamicEdge)
func EdgeDescription ¶
func EdgeDescription(description string) ReachableOption
func EdgeLabel ¶
func EdgeLabel(label string) ReachableOption
type RouteBuilder ¶
type RouteBuilder[S any] struct { // contains filtered or unexported fields }
func (*RouteBuilder[S]) Otherwise ¶
func (b *RouteBuilder[S]) Otherwise(target string) *StateGraph[S]
func (*RouteBuilder[S]) When ¶
func (b *RouteBuilder[S]) When(predicate Predicate[S], target string) *RouteBuilder[S]
type RouteSelection ¶
type Snapshot ¶
type Snapshot struct {
WorkflowID string `json:"workflow_id"`
Start string `json:"start"`
Finish []string `json:"finish"`
Nodes []NodeSnapshot `json:"nodes"`
Edges []EdgeSnapshot `json:"edges"`
}
type StateGraph ¶
type StateGraph[S any] struct { // contains filtered or unexported fields }
func NewStateGraph ¶
func NewStateGraph[S any](workflowID string) *StateGraph[S]
func (*StateGraph[S]) Edge ¶
func (g *StateGraph[S]) Edge(from string, to string) *StateGraph[S]
func (*StateGraph[S]) Finish ¶
func (g *StateGraph[S]) Finish(ids ...string) *StateGraph[S]
func (*StateGraph[S]) FixedTargets ¶
func (g *StateGraph[S]) FixedTargets(id string) []string
func (*StateGraph[S]) Flow ¶
func (g *StateGraph[S]) Flow(ids ...string) *StateGraph[S]
func (*StateGraph[S]) HasNode ¶
func (g *StateGraph[S]) HasNode(id string) bool
func (*StateGraph[S]) IsFinish ¶
func (g *StateGraph[S]) IsFinish(id string) bool
func (*StateGraph[S]) Node ¶
func (g *StateGraph[S]) Node(spec NodeSpec[S]) *StateGraph[S]
func (*StateGraph[S]) Reachable ¶
func (g *StateGraph[S]) Reachable(from string, to string, opts ...ReachableOption) *StateGraph[S]
func (*StateGraph[S]) Route ¶
func (g *StateGraph[S]) Route(from string) *RouteBuilder[S]
func (*StateGraph[S]) SelectRoute ¶
func (g *StateGraph[S]) SelectRoute(ctx context.Context, from string, state S) (RouteSelection, bool, error)
func (*StateGraph[S]) Snapshot ¶
func (g *StateGraph[S]) Snapshot() Snapshot
func (*StateGraph[S]) Start ¶
func (g *StateGraph[S]) Start(id string) *StateGraph[S]
func (*StateGraph[S]) StartNode ¶
func (g *StateGraph[S]) StartNode() string
func (*StateGraph[S]) Step ¶
func (g *StateGraph[S]) Step(id string, fn NodeFunc[S]) *StateGraph[S]
func (*StateGraph[S]) Validate ¶
func (g *StateGraph[S]) Validate() error
func (*StateGraph[S]) WorkflowID ¶
func (g *StateGraph[S]) WorkflowID() string
Click to show internal directories.
Click to hide internal directories.