hc/healthchecker.go
func Check(names ...string) []Result {
	results := make([]Result, 0, len(checkers))
	nameSet := set.FromSlice(names)
	isAll := nameSet.Includes("all")
	for _, checker := range checkers {
		if !isAll && !nameSet.Includes(checker.name) {
			continue
		}
		startTime := time.Now()
		if err := checker.check(); err != nil && err != ErrDisabledComponent {
			results = append(results, Result{
				Name:     checker.name,
				Status:   "fail - " + err.Error(),
				Duration: time.Since(startTime),
			})
		} else if err == nil {
			results = append(results, Result{
				Name:     checker.name,
				Status:   HealthCheckOK,
				Duration: time.Since(startTime),
			})
		}
	}
	return results
}
func Check(names ...string) []Result {
	results := make([]Result, 0, len(checkers))
	nameSet := set.FromSlice(names)
	isAll := nameSet.Includes("all")
	for _, checker := range checkers {
		if !isAll && !nameSet.Includes(checker.name) {
			continue
		}
		startTime := time.Now()
		if err := checker.check(); err != nil && err != ErrDisabledComponent {
			results = append(results, Result{
				Name:     checker.name,
				Status:   "fail - " + err.Error(),
				Duration: time.Since(startTime),
			})
		} else if err == nil {
			results = append(results, Result{
				Name:     checker.name,
				Status:   HealthCheckOK,
				Duration: time.Since(startTime),
			})
		}
	}
	return results
}
// Check check the status of registered checkers matching names and return a
// list of results.