forked from go-chassis/go-chassis
-
Notifications
You must be signed in to change notification settings - Fork 0
/
registry.go
executable file
·73 lines (66 loc) · 3.2 KB
/
registry.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
package model
//ServiceStruct SC information
type ServiceStruct struct {
Registry RegistryStruct `yaml:"registry"`
}
//RegistryStruct SC information
type RegistryStruct struct {
// NOTE: this part of struct would be deperacated later
// please use registrator instead
Disable bool `yaml:"disabled"`
Type string `yaml:"type"`
Scope string `yaml:"scope"`
AutoDiscovery bool `yaml:"autodiscovery"`
AutoIPIndex bool `yaml:"autoIPIndex"`
Address string `yaml:"address"`
RefreshInterval string `yaml:"refreshInterval"`
Watch bool `yaml:"watch"`
Tenant string `yaml:"tenant"`
AutoRegister string `yaml:"register"`
APIVersion RegistryAPIVersionStruct `yaml:"api"`
// Use Registrator ServiceDiscovery and ContractDiscovery
// to define information about service registry
Registrator RegistratorStruct `yaml:"registrator"`
ServiceDiscovery ServiceDiscoveryStruct `yaml:"serviceDiscovery"`
ContractDiscovery ContractDiscoveryStruct `yaml:"contractDiscovery"`
HealthCheck bool `yaml:"healthCheck"`
CacheIndex bool `yaml:"cacheIndex"`
}
//RegistratorStruct service registry config struct
type RegistratorStruct struct {
Disable bool `yaml:"disabled"`
Type string `yaml:"type"`
Scope string `yaml:"scope"`
Address string `yaml:"address"`
RefreshInterval string `yaml:"refreshInterval"`
Tenant string `yaml:"tenant"`
AutoRegister string `yaml:"register"`
APIVersion RegistryAPIVersionStruct `yaml:"api"`
}
//ServiceDiscoveryStruct service discovery config struct
type ServiceDiscoveryStruct struct {
Disable bool `yaml:"disabled"`
Type string `yaml:"type"`
AutoDiscovery bool `yaml:"autodiscovery"`
AutoIPIndex bool `yaml:"autoIPIndex"`
Address string `yaml:"address"`
RefreshInterval string `yaml:"refreshInterval"`
Watch bool `yaml:"watch"`
Tenant string `yaml:"tenant"`
ConfigPath string `yaml:"configPath"`
APIVersion RegistryAPIVersionStruct `yaml:"api"`
HealthCheck bool `yaml:"healthCheck"`
}
//ContractDiscoveryStruct contract discovery config struct
type ContractDiscoveryStruct struct {
Disable bool `yaml:"disabled"`
Type string `yaml:"type"`
Address string `yaml:"address"`
RefreshInterval string `yaml:"refreshInterval"`
Tenant string `yaml:"tenant"`
APIVersion RegistryAPIVersionStruct `yaml:"api"`
}
// RegistryAPIVersionStruct registry api version structure
type RegistryAPIVersionStruct struct {
Version string `yaml:"version"`
}