/
ca_certificate.pb.equal.go
103 lines (87 loc) · 1.99 KB
/
ca_certificate.pb.equal.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
// Code generated by protoc-gen-ext. DO NOT EDIT.
// source: github.com/xdmybl/gate-type/proto/gate/v1/ca_certificate.proto
package v1
import (
"bytes"
"encoding/binary"
"errors"
"fmt"
"strings"
"github.com/golang/protobuf/proto"
equality "github.com/solo-io/protoc-gen-ext/pkg/equality"
)
// ensure the imports are used
var (
_ = errors.New("")
_ = fmt.Print
_ = binary.LittleEndian
_ = bytes.Compare
_ = strings.Compare
_ = equality.Equalizer(nil)
_ = proto.Message(nil)
)
// Equal function
func (m *CaCertificateSpec) Equal(that interface{}) bool {
if that == nil {
return m == nil
}
target, ok := that.(*CaCertificateSpec)
if !ok {
that2, ok := that.(CaCertificateSpec)
if ok {
target = &that2
} else {
return false
}
}
if target == nil {
return m == nil
} else if m == nil {
return false
}
if h, ok := interface{}(m.GetCommonInfo()).(equality.Equalizer); ok {
if !h.Equal(target.GetCommonInfo()) {
return false
}
} else {
if !proto.Equal(m.GetCommonInfo(), target.GetCommonInfo()) {
return false
}
}
if h, ok := interface{}(m.GetCertificateInfo()).(equality.Equalizer); ok {
if !h.Equal(target.GetCertificateInfo()) {
return false
}
} else {
if !proto.Equal(m.GetCertificateInfo(), target.GetCertificateInfo()) {
return false
}
}
if strings.Compare(m.GetCa(), target.GetCa()) != 0 {
return false
}
if strings.Compare(m.GetCrl(), target.GetCrl()) != 0 {
return false
}
if m.GetAllowExpiredCertificate() != target.GetAllowExpiredCertificate() {
return false
}
if h, ok := interface{}(m.GetTlsParameters()).(equality.Equalizer); ok {
if !h.Equal(target.GetTlsParameters()) {
return false
}
} else {
if !proto.Equal(m.GetTlsParameters(), target.GetTlsParameters()) {
return false
}
}
if len(m.GetAlpnProtocols()) != len(target.GetAlpnProtocols()) {
return false
}
for idx, v := range m.GetAlpnProtocols() {
if strings.Compare(v, target.GetAlpnProtocols()[idx]) != 0 {
return false
}
}
return true
}