MCPcopy Create free account
hub / github.com/sourcegraph/checkup / checkDown

Method checkDown

check/exec/exec.go:171–183  ·  view source on GitHub ↗

checkDown checks whether the endpoint is down based on resp and the configuration of c. It returns a non-nil error if down. Note that it does not check for degraded response.

(body string)

Source from the content-addressed store, hash-verified

169// the configuration of c. It returns a non-nil error if down.
170// Note that it does not check for degraded response.
171func (c Checker) checkDown(body string) error {
172 // Check response body
173 if c.MustContain == "" && c.MustNotContain == "" {
174 return nil
175 }
176 if c.MustContain != "" && !strings.Contains(body, c.MustContain) {
177 return fmt.Errorf("response does not contain '%s'", c.MustContain)
178 }
179 if c.MustNotContain != "" && strings.Contains(body, c.MustNotContain) {
180 return fmt.Errorf("response contains '%s'", c.MustNotContain)
181 }
182 return nil
183}

Callers 1

doChecksMethod · 0.95

Implementers 6

fakecheckup_test.go
Checkercheck/http/http.go
Checkercheck/dns/dns.go
Checkercheck/exec/exec.go
Checkercheck/tls/tls.go
Checkercheck/tcp/tcp.go

Calls

no outgoing calls

Tested by

no test coverage detected