mirror of https://github.com/docker/docs.git
update file
This commit is contained in:
parent
2e6c8cc00c
commit
f04af68d3f
|
|
@ -30,7 +30,7 @@ func Register(scheme string, initFunc InitFunc) error {
|
||||||
if _, exists := discoveries[scheme]; exists {
|
if _, exists := discoveries[scheme]; exists {
|
||||||
return fmt.Errorf("scheme already registered %s", scheme)
|
return fmt.Errorf("scheme already registered %s", scheme)
|
||||||
}
|
}
|
||||||
fmt.Printf("Registering %q discovery service", scheme)
|
log.Debugf("Registering %q discovery service", scheme)
|
||||||
discoveries[scheme] = initFunc
|
discoveries[scheme] = initFunc
|
||||||
|
|
||||||
return nil
|
return nil
|
||||||
|
|
@ -43,8 +43,8 @@ func New(rawurl string) (DiscoveryService, error) {
|
||||||
}
|
}
|
||||||
|
|
||||||
if initFct, exists := discoveries[url.Scheme]; exists {
|
if initFct, exists := discoveries[url.Scheme]; exists {
|
||||||
log.Debugf("Initialising %q discovery service with %q", url.Scheme, url.Host)
|
log.Debugf("Initialising %q discovery service with %q", url.Scheme, url.Host+url.Path)
|
||||||
return initFct(url.Host)
|
return initFct(url.Host + url.Path)
|
||||||
}
|
}
|
||||||
|
|
||||||
return nil, ErrNotSupported
|
return nil, ErrNotSupported
|
||||||
|
|
|
||||||
|
|
@ -27,7 +27,14 @@ func (s FileDiscoveryService) Fetch() ([]string, error) {
|
||||||
return nil, err
|
return nil, err
|
||||||
}
|
}
|
||||||
|
|
||||||
return strings.Split(string(data), "\n"), nil
|
lines := []string{}
|
||||||
|
|
||||||
|
for _, line := range strings.Split(string(data), "\n") {
|
||||||
|
if line != "" {
|
||||||
|
lines = append(lines, line)
|
||||||
|
}
|
||||||
|
}
|
||||||
|
return lines, nil
|
||||||
}
|
}
|
||||||
|
|
||||||
func (s FileDiscoveryService) Watch(heartbeat int) <-chan time.Time {
|
func (s FileDiscoveryService) Watch(heartbeat int) <-chan time.Time {
|
||||||
|
|
|
||||||
Loading…
Reference in New Issue