-
-
Notifications
You must be signed in to change notification settings - Fork 34
/
router.go
52 lines (42 loc) · 1.14 KB
/
router.go
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
package kis
import (
"context"
"github.com/aceld/kis-flow/common"
)
/*
Function Call
*/
// funcRouter
// key: Function Name
// value: FaaSDesc callback description for custom business
type funcRouter map[string]*FaaSDesc
// flowRouter
// key: Flow Name
// value: Flow
type flowRouter map[string]Flow
/*
Connector Init
*/
// ConnInit Connector third-party storage initialization
type ConnInit func(conn Connector) error
// connInitRouter
// key: Connector Name
// value: ConnInit
type connInitRouter map[string]ConnInit
/*
Connector Call
*/
// CaaS Connector storage read/write business implementation
type CaaS func(context.Context, Connector, Function, Flow, interface{}) (interface{}, error)
// connFuncRouter Maps CaaS callback storage business to FunctionName
// key: Function Name
// value: Connector storage read/write business implementation
type connFuncRouter map[string]CaaS
// connSL Splits connFuncRouter into two subtrees based on KisMode
// key: Function KisMode S/L
// value: connFuncRouter
type connSL map[common.KisMode]connFuncRouter
// connTree
// key: Connector Name
// value: connSL second-level tree
type connTree map[string]connSL