dgr/discovery/discovery.go
func DiscoverWalk(app App, insecure discovery.InsecureOption, discoverFn DiscoverWalkFunc) (err error) {
	var (
		eps *Endpoints
	)

	parts := strings.Split(string(app.Name), "/")
	for i := range parts {
		end := len(parts) - i
		pre := strings.Join(parts[:end], "/")

		eps, err = doDiscover(pre, app, insecure)
		if derr := discoverFn(pre, eps, err); derr != nil {
			return derr
		}
	}

	return
}
func DiscoverWalk(app App, insecure discovery.InsecureOption, discoverFn DiscoverWalkFunc) (err error) {
	var (
		eps *Endpoints
	)

	parts := strings.Split(string(app.Name), "/")
	for i := range parts {
		end := len(parts) - i
		pre := strings.Join(parts[:end], "/")

		eps, err = doDiscover(pre, app, insecure)
		if derr := discoverFn(pre, eps, err); derr != nil {
			return derr
		}
	}

	return
}
// DiscoverWalk will make HTTPS requests to find discovery meta tags and
// optionally will use HTTP if insecure is set. Based on the response of the
// discoverFn it will continue to recurse up the tree.