open-consul/command/agent/catalog_endpoint.go

14 lines
261 B
Go
Raw Normal View History

2013-12-23 22:26:34 +00:00
package agent
import (
"net/http"
)
func (s *HTTPServer) CatalogDatacenters(req *http.Request) (interface{}, error) {
var out []string
if err := s.agent.RPC("Catalog.ListDatacenters", struct{}{}, &out); err != nil {
return nil, err
}
return out, nil
}