-
Notifications
You must be signed in to change notification settings - Fork 7
/
types.go
76 lines (61 loc) · 2.23 KB
/
types.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
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
package cli
import (
"context"
"sync"
"golang.org/x/time/rate"
"k8s.io/client-go/kubernetes"
"k8s.io/client-go/rest"
gwapi "sigs.k8s.io/gateway-api/pkg/client/clientset/versioned"
"github.com/flomesh-io/fsm/pkg/connector"
configClientset "github.com/flomesh-io/fsm/pkg/gen/client/config/clientset/versioned"
connectorClientset "github.com/flomesh-io/fsm/pkg/gen/client/connector/clientset/versioned"
machineClientset "github.com/flomesh-io/fsm/pkg/gen/client/machine/clientset/versioned"
"github.com/flomesh-io/fsm/pkg/k8s/informers"
"github.com/flomesh-io/fsm/pkg/messaging"
"github.com/flomesh-io/fsm/pkg/workerpool"
)
// InformerKey stores the different Informers we keep for K8s resources
type InformerKey string
const (
// ConsulConnectors lookup identifier
ConsulConnectors InformerKey = "ConsulConnectors"
// EurekaConnectors lookup identifier
EurekaConnectors InformerKey = "EurekaConnectors"
// NacosConnectors lookup identifier
NacosConnectors InformerKey = "NacosConnectors"
// MachineConnectors lookup identifier
MachineConnectors InformerKey = "MachineConnectors"
// GatewayConnectors lookup identifier
GatewayConnectors InformerKey = "GatewayConnectors"
)
// client is the type used to represent the k8s client for the connector resources
type client struct {
connectorProvider string
connectorName string
connectorSpec interface{}
connectorUID string
connectorHash uint64
clusterSet string
informers *informers.InformerCollection
msgBroker *messaging.Broker
msgWorkQueues *workerpool.WorkerPool
// msgWorkerPoolSize is the default number of workerpool workers (0 is GOMAXPROCS)
msgWorkerPoolSize int
kubeConfig *rest.Config
kubeClient kubernetes.Interface
configClient configClientset.Interface
connectorClient connectorClientset.Interface
machineClient machineClientset.Interface
gatewayClient gwapi.Interface
discClient connector.ServiceDiscoveryClient
lock sync.Mutex
limiter *rate.Limiter
context context.Context
cancelFuncs []context.CancelFunc
c2kContext *connector.C2KContext
k2cContext *connector.K2CContext
k2gContext *connector.K2GContext
serviceInstanceIDFunc connector.ServiceInstanceIDFunc
toK8sServiceCnt, fromK8sServiceCnt int
cache
}