# README
flow
编写程序main.go
package main
import (
"fmt"
"os"
"pkg.oars.vip/go-pkg/flow"
)
type Sum struct {
X float64 `yaml:"x"`
Y float64 `yaml:"y"`
}
func (a *Sum) Do(conf *Config, params interface{}) (interface{}, error) {
args := params.(Sum)
return args.X + args.Y, nil
}
func (a *Sum) Params() interface{} {
return Sum{}
}
func (a *Sum) Scheme() string {
return ""
}
func main() {
flow.AddCustomActions("sum", &Sum{})
err := flow.Run(os.Args[1])
fmt.Println(err)
}
编写脚本test.yaml
tasks:
- sum:
x: 1
"y": 1
output: $.values.sum
- print: $.values.sum
运行脚本
go run main.go test.yaml
# Functions
No description provided by the author
No description provided by the author
No description provided by the author
No description provided by the author
No description provided by the author
No description provided by the author
No description provided by the author
No description provided by the author
No description provided by the author
# Variables
No description provided by the author
No description provided by the author
No description provided by the author
No description provided by the author
# Structs
No description provided by the author
No description provided by the author
No description provided by the author
No description provided by the author
No description provided by the author
No description provided by the author
No description provided by the author
No description provided by the author
No description provided by the author
No description provided by the author
No description provided by the author
No description provided by the author
No description provided by the author
# Interfaces
No description provided by the author
# Type aliases
No description provided by the author
No description provided by the author
No description provided by the author