Documentation ¶
Overview ¶
Returns a concise representation of the cluster health.
Index ¶
- Variables
- type Health
- func (r Health) Do(providedCtx 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(providedCtx context.Context) (bool, error)
- func (r Health) Perform(providedCtx 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/current/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 ¶
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 ¶
type Response []types.HealthRecord