func (c *Client) Plugins() ([]string, error) {
	stats, err := c.ClusterStats().Do(context.Background())
	if err != nil {
		return nil, err
	}
	if stats == nil {
		return nil, err
	}
	if stats.Nodes == nil {
		return nil, err
	}
	var plugins []string
	for _, plugin := range stats.Nodes.Plugins {
		plugins = append(plugins, plugin.Name)
	}
	return plugins, nil
}
Plugins returns the list of all registered plugins.
package elastic
import "context"
func (c *Client) HasPlugin(name string) (bool, error) {
	plugins, err := c.Plugins()
	if err != nil {
		return false, nil
	}
	for _, plugin := range plugins {
		if plugin == name {
			return true, nil
		}
	}
	return false, nil
}