Documentation ¶
Overview ¶
Returns a concise representation of the cluster health.
Index ¶
- Variables
- type Health
- func (r Health) Do(ctx context.Context) (Response, error)
- func (r *Health) Header(key, value string) *Health
- func (r *Health) HttpRequest(ctx context.Context) (*http.Request, error)
- func (r Health) IsSuccess(ctx context.Context) (bool, error)
- func (r Health) Perform(ctx context.Context) (*http.Response, error)
- func (r *Health) Time(time timeunit.TimeUnit) *Health
- func (r *Health) Ts(ts bool) *Health
- type NewHealth
- type Response
Constants ¶
This section is empty.
Variables ¶
var ErrBuildPath = errors.New("cannot build path, check for missing path parameters")
ErrBuildPath is returned in case of missing parameters within the build of the request.
Functions ¶
This section is empty.
Types ¶
type Health ¶
type Health struct {
// contains filtered or unexported fields
}
func New ¶
func New(tp elastictransport.Interface) *Health
Returns a concise representation of the cluster health.
https://www.elastic.co/guide/en/elasticsearch/reference/{branch}/cat-health.html
func (Health) Do ¶
Do runs the request through the transport, handle the response and returns a health.Response
func (*Health) HttpRequest ¶
HttpRequest returns the http.Request object built from the given parameters.
func (Health) IsSuccess ¶
IsSuccess allows to run a query with a context and retrieve the result as a boolean. This only exists for endpoints without a request payload and allows for quick control flow.
func (Health) Perform ¶ added in v8.7.0
Perform runs the http.Request through the provided transport and returns an http.Response.
type NewHealth ¶
type NewHealth func() *Health
NewHealth type alias for index.
func NewHealthFunc ¶
func NewHealthFunc(tp elastictransport.Interface) NewHealth
NewHealthFunc returns a new instance of Health with the provided transport. Used in the index of the library this allows to retrieve every apis in once place.
type Response ¶ added in v8.7.0
type Response []types.HealthRecord