CheckHTTPCode use a heath check
(path string, interval time.Duration, timeout time.Duration)
| 36 | |
| 37 | // CheckHTTPCode use a heath check |
| 38 | func (sb *ServerBuilder) CheckHTTPCode(path string, interval time.Duration, timeout time.Duration) *ServerBuilder { |
| 39 | if sb.value.HeathCheck == nil { |
| 40 | sb.value.HeathCheck = &metapb.HeathCheck{} |
| 41 | |
| 42 | } |
| 43 | |
| 44 | sb.value.HeathCheck.Path = path |
| 45 | sb.value.HeathCheck.Body = "" |
| 46 | sb.value.HeathCheck.CheckInterval = int64(interval) |
| 47 | sb.value.HeathCheck.Timeout = int64(timeout) |
| 48 | return sb |
| 49 | } |
| 50 | |
| 51 | // CheckHTTPBody use a heath check |
| 52 | func (sb *ServerBuilder) CheckHTTPBody(path, body string, interval time.Duration, timeout time.Duration) *ServerBuilder { |