-
Notifications
You must be signed in to change notification settings - Fork 2
/
check_instance.go
28 lines (25 loc) · 1.26 KB
/
check_instance.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
package proto
type CheckInstance struct {
InstanceId string `json:"instanceId,omitempty"`
CheckId string `json:"checkId,omitempty"`
ConfigId string `json:"configId,omitempty"`
InstanceConfigId string `json:"instanceConfigId,omitempty"`
Version uint64 `json:"version"`
ConstraintHash string `json:"constraintHash,omitempty"`
ConstraintValHash string `json:"constraintValHash,omitempty"`
InstanceSvcCfgHash string `json:"instanceSvcCfghash,omitempty"`
InstanceService string `json:"instanceService,omitempty"`
InstanceServiceConfig string `json:"instanceServiceCfg,omitempty"`
}
func (t *CheckInstance) DeepCompare(a *CheckInstance) bool {
if t.InstanceId != a.InstanceId || t.CheckId != a.CheckId || t.ConfigId != a.ConfigId ||
t.ConstraintHash != a.ConstraintHash || t.ConstraintValHash != a.ConstraintValHash ||
t.InstanceSvcCfgHash != a.InstanceSvcCfgHash || t.InstanceService != a.InstanceService {
// - InstanceConfigId is a randomly generated uuid on every instance calculation
// - Version is incremented on every instance calculation
// - InstanceServiceConfig is compared as deploymentdetails.Service
return false
}
return true
}
// vim: ts=4 sw=4 sts=4 noet fenc=utf-8 ffs=unix