-
Notifications
You must be signed in to change notification settings - Fork 7
/
types.go
44 lines (35 loc) · 1.22 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
// Package ctok contains a reusable abstraction for efficiently
// watching for changes in resources in a Kubernetes cluster.
package ctok
import "context"
const (
// CloudSourcedServiceLabel defines cloud-sourced service label
CloudSourcedServiceLabel = "fsm-connector-cloud-sourced-service"
// CloudServiceLabel defines cloud service label
CloudServiceLabel = "fsm-connector-cloud-service"
)
// MicroSvcName defines string as microservice name
type MicroSvcName string
// MicroSvcDomainName defines string as microservice domain name
type MicroSvcDomainName string
// MicroEndpointAddr defines string as micro endpoint addr
type MicroEndpointAddr string
// MicroSvcPort defines int as micro service port
type MicroSvcPort int
// MicroSvcAppProtocol defines app protocol
type MicroSvcAppProtocol string
// MicroSvcMeta defines micro service meta
type MicroSvcMeta struct {
Ports map[MicroSvcPort]MicroSvcAppProtocol
Addresses map[MicroEndpointAddr]int
ClusterSet string
ClusterId string
WithGateway bool
ViaGateway string
HealthCheck bool
}
// Aggregator aggregates micro services
type Aggregator interface {
// Aggregate micro services
Aggregate(context.Context, MicroSvcName) map[MicroSvcName]*MicroSvcMeta
}