kis-flow/kis/router.go

53 lines
1.1 KiB
Go
Raw Normal View History

2024-01-04 16:36:36 +08:00
package kis
2024-01-09 17:30:58 +08:00
import (
"context"
2024-03-26 14:54:50 +08:00
"github.com/aceld/kis-flow/common"
2024-01-09 17:30:58 +08:00
)
2024-01-04 16:36:36 +08:00
// FaaS 定义移植到 faas.go 中
2024-01-09 17:30:58 +08:00
/*
Function Call
*/
2024-01-04 16:36:36 +08:00
// funcRouter
// key: Function Name
2024-03-19 19:16:03 +08:00
// value: FaaSDesc 回调自定义业务的描述
type funcRouter map[string]*FaaSDesc
2024-01-04 16:36:36 +08:00
// flowRouter
// key: Flow Name
// value: Flow
type flowRouter map[string]Flow
2024-01-09 17:30:58 +08:00
/*
Connector Init
*/
// ConnInit Connector 第三方挂载存储初始化
type ConnInit func(conn Connector) error
// connInitRouter
2024-03-19 19:16:03 +08:00
// key:
2024-01-09 17:30:58 +08:00
type connInitRouter map[string]ConnInit
/*
Connector Call
*/
// CaaS Connector的存储读取业务实现
type CaaS func(context.Context, Connector, Function, Flow, interface{}) error
// connFuncRouter 通过FunctionName索引到CaaS回调存储业务的映射关系
// key: Function Name
// value: Connector的存储读取业务实现
type connFuncRouter map[string]CaaS
// connSL 通过KisMode 将connFuncRouter分为两个子树
// key: Function KisMode S/L
// value: NsConnRouter
type connSL map[common.KisMode]connFuncRouter
// connTree
// key: Connector Name
// value: connSL 二级树
type connTree map[string]connSL