Lint code
This commit is contained in:
parent
a56dd7cc38
commit
681ca36b1c
10 changed files with 21 additions and 2 deletions
|
@ -53,6 +53,7 @@ type BasicDigest struct {
|
||||||
Secured bool `json:"secured"`
|
Secured bool `json:"secured"`
|
||||||
}
|
}
|
||||||
|
|
||||||
|
// Equal tests for equality between two BasicDigest types
|
||||||
func (bd1 *BasicDigest) Equal(bd2 *BasicDigest) bool {
|
func (bd1 *BasicDigest) Equal(bd2 *BasicDigest) bool {
|
||||||
if bd1 == bd2 {
|
if bd1 == bd2 {
|
||||||
return true
|
return true
|
||||||
|
|
|
@ -47,6 +47,7 @@ type External struct {
|
||||||
ResponseHeaders []string `json:"responseHeaders,omitEmpty"`
|
ResponseHeaders []string `json:"responseHeaders,omitEmpty"`
|
||||||
}
|
}
|
||||||
|
|
||||||
|
// Equal tests for equality between two External types
|
||||||
func (e1 *External) Equal(e2 *External) bool {
|
func (e1 *External) Equal(e2 *External) bool {
|
||||||
if e1 == e2 {
|
if e1 == e2 {
|
||||||
return true
|
return true
|
||||||
|
|
|
@ -40,6 +40,7 @@ type AuthSSLConfig struct {
|
||||||
ValidationDepth int `json:"validationDepth"`
|
ValidationDepth int `json:"validationDepth"`
|
||||||
}
|
}
|
||||||
|
|
||||||
|
// Equal tests for equality between two AuthSSLConfig types
|
||||||
func (assl1 *AuthSSLConfig) Equal(assl2 *AuthSSLConfig) bool {
|
func (assl1 *AuthSSLConfig) Equal(assl2 *AuthSSLConfig) bool {
|
||||||
if assl1 == assl2 {
|
if assl1 == assl2 {
|
||||||
return true
|
return true
|
||||||
|
|
|
@ -39,6 +39,7 @@ type SourceRange struct {
|
||||||
CIDR []string `json:"cidr,omitEmpty"`
|
CIDR []string `json:"cidr,omitEmpty"`
|
||||||
}
|
}
|
||||||
|
|
||||||
|
// Equal tests for equality between two SourceRange types
|
||||||
func (sr1 *SourceRange) Equal(sr2 *SourceRange) bool {
|
func (sr1 *SourceRange) Equal(sr2 *SourceRange) bool {
|
||||||
if sr1 == sr2 {
|
if sr1 == sr2 {
|
||||||
return true
|
return true
|
||||||
|
|
|
@ -46,6 +46,7 @@ type Configuration struct {
|
||||||
NextUpstream string `json:"nextUpstream"`
|
NextUpstream string `json:"nextUpstream"`
|
||||||
}
|
}
|
||||||
|
|
||||||
|
// Equal tests for equality between two Configuration types
|
||||||
func (l1 *Configuration) Equal(l2 *Configuration) bool {
|
func (l1 *Configuration) Equal(l2 *Configuration) bool {
|
||||||
if l1 == l2 {
|
if l1 == l2 {
|
||||||
return true
|
return true
|
||||||
|
|
|
@ -47,6 +47,7 @@ type RateLimit struct {
|
||||||
RPS Zone `json:"rps"`
|
RPS Zone `json:"rps"`
|
||||||
}
|
}
|
||||||
|
|
||||||
|
// Equal tests for equality between two RateLimit types
|
||||||
func (rt1 *RateLimit) Equal(rt2 *RateLimit) bool {
|
func (rt1 *RateLimit) Equal(rt2 *RateLimit) bool {
|
||||||
if rt1 == rt2 {
|
if rt1 == rt2 {
|
||||||
return true
|
return true
|
||||||
|
@ -74,6 +75,7 @@ type Zone struct {
|
||||||
SharedSize int `json:"sharedSize"`
|
SharedSize int `json:"sharedSize"`
|
||||||
}
|
}
|
||||||
|
|
||||||
|
// Equal tests for equality between two Zone types
|
||||||
func (z1 *Zone) Equal(z2 *Zone) bool {
|
func (z1 *Zone) Equal(z2 *Zone) bool {
|
||||||
if z1 == z2 {
|
if z1 == z2 {
|
||||||
return true
|
return true
|
||||||
|
|
|
@ -46,6 +46,7 @@ type Redirect struct {
|
||||||
AppRoot string `json:"appRoot"`
|
AppRoot string `json:"appRoot"`
|
||||||
}
|
}
|
||||||
|
|
||||||
|
// Equal tests for equality between two Redirect types
|
||||||
func (r1 *Redirect) Equal(r2 *Redirect) bool {
|
func (r1 *Redirect) Equal(r2 *Redirect) bool {
|
||||||
if r1 == r2 {
|
if r1 == r2 {
|
||||||
return true
|
return true
|
||||||
|
|
|
@ -19,10 +19,10 @@ package serviceupstream
|
||||||
import (
|
import (
|
||||||
"testing"
|
"testing"
|
||||||
|
|
||||||
meta_v1 "k8s.io/apimachinery/pkg/apis/meta/v1"
|
|
||||||
"k8s.io/apimachinery/pkg/util/intstr"
|
|
||||||
api "k8s.io/api/core/v1"
|
api "k8s.io/api/core/v1"
|
||||||
extensions "k8s.io/api/extensions/v1beta1"
|
extensions "k8s.io/api/extensions/v1beta1"
|
||||||
|
meta_v1 "k8s.io/apimachinery/pkg/apis/meta/v1"
|
||||||
|
"k8s.io/apimachinery/pkg/util/intstr"
|
||||||
)
|
)
|
||||||
|
|
||||||
func buildIngress() *extensions.Ingress {
|
func buildIngress() *extensions.Ingress {
|
||||||
|
|
|
@ -52,6 +52,7 @@ type AuthSSLCert struct {
|
||||||
PemSHA string `json:"pemSha"`
|
PemSHA string `json:"pemSha"`
|
||||||
}
|
}
|
||||||
|
|
||||||
|
// Equal tests for equality between two AuthSSLCert types
|
||||||
func (asslc1 *AuthSSLCert) Equal(assl2 *AuthSSLCert) bool {
|
func (asslc1 *AuthSSLCert) Equal(assl2 *AuthSSLCert) bool {
|
||||||
if asslc1.Secret != assl2.Secret {
|
if asslc1.Secret != assl2.Secret {
|
||||||
return false
|
return false
|
||||||
|
|
|
@ -16,6 +16,7 @@ limitations under the License.
|
||||||
|
|
||||||
package ingress
|
package ingress
|
||||||
|
|
||||||
|
// Equal tests for equality between two BackendInfo types
|
||||||
func (bi1 *BackendInfo) Equal(bi2 *BackendInfo) bool {
|
func (bi1 *BackendInfo) Equal(bi2 *BackendInfo) bool {
|
||||||
if bi1 == bi2 {
|
if bi1 == bi2 {
|
||||||
return true
|
return true
|
||||||
|
@ -39,6 +40,7 @@ func (bi1 *BackendInfo) Equal(bi2 *BackendInfo) bool {
|
||||||
return true
|
return true
|
||||||
}
|
}
|
||||||
|
|
||||||
|
// Equal tests for equality between two Configuration types
|
||||||
func (c1 *Configuration) Equal(c2 *Configuration) bool {
|
func (c1 *Configuration) Equal(c2 *Configuration) bool {
|
||||||
if c1 == c2 {
|
if c1 == c2 {
|
||||||
return true
|
return true
|
||||||
|
@ -135,6 +137,7 @@ func (c1 *Configuration) Equal(c2 *Configuration) bool {
|
||||||
return true
|
return true
|
||||||
}
|
}
|
||||||
|
|
||||||
|
// Equal tests for equality between two Backend types
|
||||||
func (b1 *Backend) Equal(b2 *Backend) bool {
|
func (b1 *Backend) Equal(b2 *Backend) bool {
|
||||||
if b1 == b2 {
|
if b1 == b2 {
|
||||||
return true
|
return true
|
||||||
|
@ -199,6 +202,7 @@ func (b1 *Backend) Equal(b2 *Backend) bool {
|
||||||
return true
|
return true
|
||||||
}
|
}
|
||||||
|
|
||||||
|
// Equal tests for equality between two SessionAffinityConfig types
|
||||||
func (sac1 *SessionAffinityConfig) Equal(sac2 *SessionAffinityConfig) bool {
|
func (sac1 *SessionAffinityConfig) Equal(sac2 *SessionAffinityConfig) bool {
|
||||||
if sac1 == sac2 {
|
if sac1 == sac2 {
|
||||||
return true
|
return true
|
||||||
|
@ -216,6 +220,7 @@ func (sac1 *SessionAffinityConfig) Equal(sac2 *SessionAffinityConfig) bool {
|
||||||
return true
|
return true
|
||||||
}
|
}
|
||||||
|
|
||||||
|
// Equal tests for equality between two CookieSessionAffinity types
|
||||||
func (csa1 *CookieSessionAffinity) Equal(csa2 *CookieSessionAffinity) bool {
|
func (csa1 *CookieSessionAffinity) Equal(csa2 *CookieSessionAffinity) bool {
|
||||||
if csa1 == csa2 {
|
if csa1 == csa2 {
|
||||||
return true
|
return true
|
||||||
|
@ -257,6 +262,7 @@ func (e1 *Endpoint) Equal(e2 *Endpoint) bool {
|
||||||
return true
|
return true
|
||||||
}
|
}
|
||||||
|
|
||||||
|
// Equal tests for equality between two Server types
|
||||||
func (s1 *Server) Equal(s2 *Server) bool {
|
func (s1 *Server) Equal(s2 *Server) bool {
|
||||||
if s1 == s2 {
|
if s1 == s2 {
|
||||||
return true
|
return true
|
||||||
|
@ -297,6 +303,7 @@ func (s1 *Server) Equal(s2 *Server) bool {
|
||||||
return true
|
return true
|
||||||
}
|
}
|
||||||
|
|
||||||
|
// Equal tests for equality between two Location types
|
||||||
func (l1 *Location) Equal(l2 *Location) bool {
|
func (l1 *Location) Equal(l2 *Location) bool {
|
||||||
if l1 == l2 {
|
if l1 == l2 {
|
||||||
return true
|
return true
|
||||||
|
@ -371,6 +378,7 @@ func (l1 *Location) Equal(l2 *Location) bool {
|
||||||
return true
|
return true
|
||||||
}
|
}
|
||||||
|
|
||||||
|
// Equal tests for equality between two SSLPassthroughBackend types
|
||||||
func (ptb1 *SSLPassthroughBackend) Equal(ptb2 *SSLPassthroughBackend) bool {
|
func (ptb1 *SSLPassthroughBackend) Equal(ptb2 *SSLPassthroughBackend) bool {
|
||||||
if ptb1 == ptb2 {
|
if ptb1 == ptb2 {
|
||||||
return true
|
return true
|
||||||
|
@ -407,6 +415,7 @@ func (ptb1 *SSLPassthroughBackend) Equal(ptb2 *SSLPassthroughBackend) bool {
|
||||||
return true
|
return true
|
||||||
}
|
}
|
||||||
|
|
||||||
|
// Equal tests for equality between two L4Service types
|
||||||
func (e1 *L4Service) Equal(e2 *L4Service) bool {
|
func (e1 *L4Service) Equal(e2 *L4Service) bool {
|
||||||
if e1 == e2 {
|
if e1 == e2 {
|
||||||
return true
|
return true
|
||||||
|
@ -440,6 +449,7 @@ func (e1 *L4Service) Equal(e2 *L4Service) bool {
|
||||||
return true
|
return true
|
||||||
}
|
}
|
||||||
|
|
||||||
|
// Equal tests for equality between two L4Backend types
|
||||||
func (l4b1 *L4Backend) Equal(l4b2 *L4Backend) bool {
|
func (l4b1 *L4Backend) Equal(l4b2 *L4Backend) bool {
|
||||||
if l4b1 == l4b2 {
|
if l4b1 == l4b2 {
|
||||||
return true
|
return true
|
||||||
|
|
Loading…
Reference in a new issue