func (c *conn) MarkAsHealthy() {
	c.Lock()
	c.dead = false
	c.deadSince = nil
	c.failures = 0
	c.Unlock()
}
MarkAsHealthy marks this connection as healthy, i.e. a request has been
successfully performed with it.
package elastic
import (
	"fmt"
	"sync"
	"time"
)
type conn struct {
	sync.RWMutex
	nodeID    string  
	url       string
	failures  int
	dead      bool
	deadSince *time.Time
}
func newConn(nodeID, url string) *conn {
	c := &conn{
		nodeID: nodeID,
		url:    url,
	}
	return c
}
func (c *conn) String() string {
	c.RLock()
	defer c.RUnlock()
	return fmt.Sprintf("%s [dead=%v,failures=%d,deadSince=%v]", c.url, c.dead, c.failures, c.deadSince)
}
func (c *conn) NodeID() string {
	c.RLock()
	defer c.RUnlock()
	return c.nodeID
}
func (c *conn) URL() string {
	c.RLock()
	defer c.RUnlock()
	return c.url
}
func (c *conn) IsDead() bool {
	c.RLock()
	defer c.RUnlock()
	return c.dead
}
func (c *conn) MarkAsDead() {
	c.Lock()
	c.dead = true
	if c.deadSince == nil {
		utcNow := time.Now().UTC()
		c.deadSince = &utcNow
	}
	c.failures += 1
	c.Unlock()
}
func (c *conn) MarkAsAlive() {
	c.Lock()
	c.dead = false
	c.Unlock()
}