mirror of
https://github.com/eosswedenorg/antelope-api-healthcheck
synced 2026-07-04 12:03:43 +02:00
README.md: rename parameter 3. version to api as it can be more generic then just different versions.
This commit is contained in:
parent
ddc7406a4c
commit
400ec204bc
4 changed files with 5 additions and 5 deletions
|
|
@ -43,7 +43,7 @@ first to last below:
|
||||||
| - | ---------- | ----------------------- | -------------------------------------------------------------- |
|
| - | ---------- | ----------------------- | -------------------------------------------------------------- |
|
||||||
| 1 | url | Yes (port default `80`) | http url to the api. `http(s)://<ip-or-domain>(:<port>)` |
|
| 1 | url | Yes (port default `80`) | http url to the api. `http(s)://<ip-or-domain>(:<port>)` |
|
||||||
| 2 | num_blocks | No (default `10`) | Number of blocks the api can drift before reported `down` |
|
| 2 | num_blocks | No (default `10`) | Number of blocks the api can drift before reported `down` |
|
||||||
| 3 | version | No (default `v1`) | API Version to check against, `v1` = standard, `v2` = Hyperion |
|
| 3 | api | No (default `v1`) | Type of API to check against, `v1` = standard, `v2` = Hyperion |
|
||||||
| 4 | host | No (default from `url`) | Value to send in the `HTTP Host Header` to the API |
|
| 4 | host | No (default from `url`) | Value to send in the `HTTP Host Header` to the API |
|
||||||
|
|
||||||
### Response
|
### Response
|
||||||
|
|
|
||||||
|
|
@ -6,6 +6,10 @@ import (
|
||||||
)
|
)
|
||||||
|
|
||||||
type ApiInterface interface {
|
type ApiInterface interface {
|
||||||
|
|
||||||
|
// Name of the api
|
||||||
Name() string
|
Name() string
|
||||||
|
|
||||||
|
// Call api and validate it's status.
|
||||||
Call() (haproxy.HealthCheckStatus, string)
|
Call() (haproxy.HealthCheckStatus, string)
|
||||||
}
|
}
|
||||||
|
|
|
||||||
|
|
@ -24,8 +24,6 @@ func (e EosioV1) Name() string {
|
||||||
return "v1"
|
return "v1"
|
||||||
}
|
}
|
||||||
|
|
||||||
// check_api - Validates head block time.
|
|
||||||
// ---------------------------------------------------------
|
|
||||||
func (e EosioV1) Call() (haproxy.HealthCheckStatus, string) {
|
func (e EosioV1) Call() (haproxy.HealthCheckStatus, string) {
|
||||||
|
|
||||||
info, err := eosapi.GetInfo(e.params)
|
info, err := eosapi.GetInfo(e.params)
|
||||||
|
|
|
||||||
|
|
@ -24,8 +24,6 @@ func (e EosioV2) Name() string {
|
||||||
return "v2"
|
return "v2"
|
||||||
}
|
}
|
||||||
|
|
||||||
// check_api - Validates head block time.
|
|
||||||
// ---------------------------------------------------------
|
|
||||||
func (e EosioV2) Call() (haproxy.HealthCheckStatus, string) {
|
func (e EosioV2) Call() (haproxy.HealthCheckStatus, string) {
|
||||||
|
|
||||||
health, err := eosapi.GetHealth(e.params)
|
health, err := eosapi.GetHealth(e.params)
|
||||||
|
|
|
||||||
Loading…
Add table
Add a link
Reference in a new issue