|
@@ -1,44 +1,37 @@
|
|
|
# Flow
|
|
|
|
|
|
-> A flow works by requesting the previous nodes the results of its operation,
|
|
|
-> so the starting node will be the node we want the result of, unattached nodes wont be executed`
|
|
|
+## How it works
|
|
|
|
|
|
-All nodes are Go functions.
|
|
|
-Here's an example of a Flow app with a node having a single string output:
|
|
|
+A flow works by requesting the previous nodes the results of its operation,
|
|
|
+so the starting node will be the node we want the result of, unattached nodes wont be executed
|
|
|
+
|
|
|
+All nodes are Go functions, sample with a node with one output
|
|
|
|
|
|
```go
|
|
|
package main
|
|
|
|
|
|
import (
|
|
|
- "flow/registry"
|
|
|
- "flowserver"
|
|
|
- "net/http"
|
|
|
+ "flow/flowserver"
|
|
|
+ "flow/registry"
|
|
|
+ "net/http"
|
|
|
)
|
|
|
|
|
|
func main() {
|
|
|
|
|
|
- r := registry.New()
|
|
|
- r.Add("hello", func() string {
|
|
|
- return "hello world"
|
|
|
- })
|
|
|
+ r := registry.New()
|
|
|
+ r.Add("hello", func() string {
|
|
|
+ return "hello world"
|
|
|
+ })
|
|
|
|
|
|
- http.ListenAndServe(":5000", flowserver.New(r,"storename"))
|
|
|
+ http.ListenAndServe(":5000", flowserver.New(r, "storename"))
|
|
|
|
|
|
}
|
|
|
```
|
|
|
|
|
|
-<a target="_blank" :href="'http://'+ location.host +'/c1.html'">sample1</a><br>
|
|
|
-Every function can be registered including from external packages as shown in
|
|
|
-<a target="_blank" :href="'http://'+ location.host +'/c2.html'">sample2</a><br>
|
|
|
-Describing functions:
|
|
|
-<a target="_blank" :href="'http://'+ location.host +'/c3.html'">sample3</a><br>
|
|
|
+Resulting in
|
|
|
|
|
|
-
|
|
|
+
|
|
|
|
|
|
-```go
|
|
|
-package main
|
|
|
+---
|
|
|
|
|
|
-func main() {
|
|
|
-
|
|
|
-}
|
|
|
-```
|
|
|
+> WIP
|