@@ -84,7 +84,7 @@ func (c HealthChecks) AggregatedStatus() string {
84
84
type ServiceEntry struct {
85
85
Node * Node
86
86
Service * AgentService
87
- Checks [] * HealthCheck
87
+ Checks HealthChecks
88
88
}
89
89
90
90
// Health can be used to query the Health endpoints
@@ -98,7 +98,7 @@ func (c *Client) Health() *Health {
98
98
}
99
99
100
100
// Node is used to query for checks belonging to a given node
101
- func (h * Health ) Node (node string , q * QueryOptions ) ([] * HealthCheck , * QueryMeta , error ) {
101
+ func (h * Health ) Node (node string , q * QueryOptions ) (HealthChecks , * QueryMeta , error ) {
102
102
r := h .c .newRequest ("GET" , "/v1/health/node/" + node )
103
103
r .setQueryOptions (q )
104
104
rtt , resp , err := requireOK (h .c .doRequest (r ))
@@ -111,15 +111,15 @@ func (h *Health) Node(node string, q *QueryOptions) ([]*HealthCheck, *QueryMeta,
111
111
parseQueryMeta (resp , qm )
112
112
qm .RequestTime = rtt
113
113
114
- var out [] * HealthCheck
114
+ var out HealthChecks
115
115
if err := decodeBody (resp , & out ); err != nil {
116
116
return nil , nil , err
117
117
}
118
118
return out , qm , nil
119
119
}
120
120
121
121
// Checks is used to return the checks associated with a service
122
- func (h * Health ) Checks (service string , q * QueryOptions ) ([] * HealthCheck , * QueryMeta , error ) {
122
+ func (h * Health ) Checks (service string , q * QueryOptions ) (HealthChecks , * QueryMeta , error ) {
123
123
r := h .c .newRequest ("GET" , "/v1/health/checks/" + service )
124
124
r .setQueryOptions (q )
125
125
rtt , resp , err := requireOK (h .c .doRequest (r ))
@@ -132,7 +132,7 @@ func (h *Health) Checks(service string, q *QueryOptions) ([]*HealthCheck, *Query
132
132
parseQueryMeta (resp , qm )
133
133
qm .RequestTime = rtt
134
134
135
- var out [] * HealthCheck
135
+ var out HealthChecks
136
136
if err := decodeBody (resp , & out ); err != nil {
137
137
return nil , nil , err
138
138
}
@@ -170,7 +170,7 @@ func (h *Health) Service(service, tag string, passingOnly bool, q *QueryOptions)
170
170
171
171
// State is used to retrieve all the checks in a given state.
172
172
// The wildcard "any" state can also be used for all checks.
173
- func (h * Health ) State (state string , q * QueryOptions ) ([] * HealthCheck , * QueryMeta , error ) {
173
+ func (h * Health ) State (state string , q * QueryOptions ) (HealthChecks , * QueryMeta , error ) {
174
174
switch state {
175
175
case HealthAny :
176
176
case HealthWarning :
@@ -191,7 +191,7 @@ func (h *Health) State(state string, q *QueryOptions) ([]*HealthCheck, *QueryMet
191
191
parseQueryMeta (resp , qm )
192
192
qm .RequestTime = rtt
193
193
194
- var out [] * HealthCheck
194
+ var out HealthChecks
195
195
if err := decodeBody (resp , & out ); err != nil {
196
196
return nil , nil , err
197
197
}
0 commit comments