Skip to content

Commit

Permalink
Merge pull request #23 from aceld/feature/aceld
Browse files Browse the repository at this point in the history
Add Flow func:GetId()
  • Loading branch information
aceld authored Apr 15, 2024
2 parents 3f66d6a + 517aa5b commit 313a42c
Show file tree
Hide file tree
Showing 4 changed files with 8 additions and 2 deletions.
4 changes: 4 additions & 0 deletions flow/kis_flow.go
Original file line number Diff line number Diff line change
Expand Up @@ -311,6 +311,10 @@ func (flow *KisFlow) GetName() string {
return flow.Name
}

func (flow *KisFlow) GetId() string {
return flow.Id
}

func (flow *KisFlow) GetThisFunction() kis.Function {
return flow.ThisFunction
}
Expand Down
2 changes: 2 additions & 0 deletions kis/flow.go
Original file line number Diff line number Diff line change
Expand Up @@ -53,4 +53,6 @@ type Flow interface {
GetFuncParamsAllFuncs() map[string]config.FParam
// Fork 得到Flow的一个副本(深拷贝)
Fork(ctx context.Context) Flow
// GetId 得到Flow的Id
GetId() string
}
2 changes: 1 addition & 1 deletion test/caas/caas_demo1.go
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,7 @@ import (
"github.com/aceld/kis-flow/kis"
)

// type CaaS func(context.Context, Connector, Function, Flow, interface{}) error
// type CaaS func(context.Context, Connector, Function, Flow, interface{}) (interface{}, error)

func CaasDemoHanler1(ctx context.Context, conn kis.Connector, fn kis.Function, flow kis.Flow, args interface{}) (interface{}, error) {
fmt.Printf("===> In CaasDemoHanler1: flowName: %s, cName:%s, fnName:%s, mode:%s\n",
Expand Down
2 changes: 1 addition & 1 deletion test/caas/caas_init1.go
Original file line number Diff line number Diff line change
Expand Up @@ -14,7 +14,7 @@ func InitConnDemo1(connector kis.Connector) error {

fmt.Println(connConf)

// init connector , 如 初始化数据库链接等
// init connector

return nil
}

0 comments on commit 313a42c

Please sign in to comment.