-
Notifications
You must be signed in to change notification settings - Fork 8
/
controller.go
142 lines (103 loc) · 3.63 KB
/
controller.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
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
package connector
import (
"time"
mapset "github.com/deckarep/golang-set"
ctv1 "github.com/flomesh-io/fsm/pkg/apis/connector/v1alpha1"
)
// ConnectController is the controller interface for K8s connectors
type ConnectController interface {
BroadcastListener(stopCh <-chan struct{})
GetConnectorProvider() ctv1.DiscoveryServiceProvider
GetConnectorName() string
GetConnectorUID() string
GetConsulConnector(connector string) *ctv1.ConsulConnector
GetEurekaConnector(connector string) *ctv1.EurekaConnector
GetNacosConnector(connector string) *ctv1.NacosConnector
GetMachineConnector(connector string) *ctv1.MachineConnector
GetGatewayConnector(connector string) *ctv1.GatewayConnector
GetConnector() (connector, spec interface{}, uid string, ok bool)
Refresh()
WaitLimiter()
GetC2KContext() *C2KContext
GetK2CContext() *K2CContext
GetK2GContext() *K2GContext
GetClusterSet() string
SetClusterSet(name, group, zone, region string)
SetServiceInstanceIDFunc(f ServiceInstanceIDFunc)
GetServiceInstanceID(name, addr string, httpPort, grpcPort int) string
/* config for ctok source */
GetClusterId() string
GetPassingOnly() bool
GetFilterTag() string
GetFilterMetadatas() []ctv1.Metadata
GetPrefix() string
GetPrefixTag() string
GetSuffixTag() string
GetPrefixMetadata() string
GetSuffixMetadata() string
GetC2KWithGateway() bool
GetC2KMultiGateways() bool
GetNacos2KClusterSet() []string
GetNacos2KGroupSet() []string
/* config for ktoc source */
GetSyncPeriod() time.Duration
GetDefaultSync() bool
GetSyncClusterIPServices() bool
GetSyncLoadBalancerEndpoints() bool
GetNodePortSyncType() ctv1.NodePortSyncType
GetSyncIngress() bool
GetSyncIngressLoadBalancerIPs() bool
GetAddServicePrefix() string
GetAddK8SNamespaceAsServiceSuffix() bool
GetAppendTagSet() mapset.Set
GetAppendMetadataSet() mapset.Set
GetAllowK8SNamespaceSet() mapset.Set
GetDenyK8SNamespaceSet() mapset.Set
GetK2CWithGateway() bool
GetK2CWithGatewayMode() ctv1.WithGatewayMode
GetConsulNodeName() string
GetConsulEnableNamespaces() bool
GetConsulDestinationNamespace() string
GetConsulEnableK8SNSMirroring() bool
GetConsulK8SNSMirroringPrefix() string
GetConsulCrossNamespaceACLPolicy() string
GetNacosGroupId() string
GetNacosClusterId() string
/* config for ktog source */
GetK2GDefaultSync() bool
GetK2GAllowK8SNamespaceSet() mapset.Set
GetK2GDenyK8SNamespaceSet() mapset.Set
/* config for via gateway */
GetViaIngressIPSelector() ctv1.AddrSelector
GetViaEgressIPSelector() ctv1.AddrSelector
GetViaIngressAddr() string
SetViaIngressAddr(ingressAddr string)
GetViaEgressAddr() string
SetViaEgressAddr(egressAddr string)
GetViaIngressHTTPPort() uint
SetViaIngressHTTPPort(httpPort uint)
GetViaIngressGRPCPort() uint
SetViaIngressGRPCPort(grpcPort uint)
GetViaEgressHTTPPort() uint
SetViaEgressHTTPPort(httpPort uint)
GetViaEgressGRPCPort() uint
SetViaEgressGRPCPort(grpcPort uint)
GetAuthConsulUsername() string
GetAuthConsulPassword() string
GetAuthNacosUsername() string
GetAuthNacosPassword() string
GetAuthNacosAccessKey() string
GetAuthNacosSecretKey() string
GetAuthNacosNamespaceId() string
SyncCloudToK8s() bool
SyncK8sToCloud() bool
SyncK8sToGateway() bool
GetHTTPAddr() string
GetDeriveNamespace() string
AsInternalServices() bool
CacheCatalogInstances(key string, catalogFunc func() (interface{}, error)) (interface{}, error)
CacheRegisterInstance(key string, instance interface{}, registerFunc func() error) error
CacheDeregisterInstance(key string, deregisterFunc func() error) error
CacheCleaner(stopCh <-chan struct{})
}
type ServiceInstanceIDFunc func(name, addr string, httpPort, grpcPort int) string