MCPcopy
hub / github.com/sourcegraph/checkup / Check

Method Check

check/tcp/tcp.go:57–68  ·  view source on GitHub ↗

Check performs checks using c according to its configuration. An error is only returned if there is a configuration error.

()

Source from the content-addressed store, hash-verified

55// Check performs checks using c according to its configuration.
56// An error is only returned if there is a configuration error.
57func (c Checker) Check() (types.Result, error) {
58 if c.Attempts < 1 {
59 c.Attempts = 1
60 }
61
62 result := types.NewResult()
63 result.Title = c.Name
64 result.Endpoint = c.URL
65 result.Times = c.doChecks()
66
67 return c.conclude(result), nil
68}
69
70// New creates a new Checker instance based on json config
71func New(config json.RawMessage) (Checker, error) {

Callers 5

TestCheckerFunction · 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 3

doChecksMethod · 0.95
concludeMethod · 0.95
NewResultFunction · 0.92

Tested by 5

TestCheckerFunction · 0.76