func (u *updater) Update(status error) {
	u.mu.Lock()
	defer u.mu.Unlock()
	u.status = status
}
Update implements the Updater interface, allowing asynchronous access to
the status of a Checker.
package health
import (
	"encoding/json"
	"fmt"
	"net/http"
	"sync"
	"time"
	"github.com/docker/distribution/context"
	"github.com/docker/distribution/registry/api/errcode"
)
type Registry struct {
	mu               sync.RWMutex
	registeredChecks map[string]Checker
}
func NewRegistry() *Registry {
	return &Registry{
		registeredChecks: make(map[string]Checker),
	}
}
var DefaultRegistry *Registry
type Checker interface {
	Check() error
}
type CheckFunc func() error
func (cf CheckFunc) Check() error {
	return cf()
}
type Updater interface {
	Checker
	Update(status error)
}
type updater struct {
	mu     sync.Mutex
	status error
}
func (u *updater) Check() error {
	u.mu.Lock()
	defer u.mu.Unlock()
	return u.status
}