cleanup - address review feedback

This commit is contained in:
Matt Jaffee 2018-06-25 11:08:00 -05:00
parent 6093064ac0
commit 8878b02345
No known key found for this signature in database
GPG key ID: 08A3DFFF987B11BF
3 changed files with 4 additions and 12 deletions

2
api.go
View file

@ -50,7 +50,7 @@ type API struct {
}
// APIOption is a functional option type for pilosa.API
type APIOption func(s *API) error
type APIOption func(*API) error
func OptAPIServer(s *Server) APIOption {
return func(a *API) error {

View file

@ -87,11 +87,10 @@ func TestImportCommand_RunValue(t *testing.T) {
}
cmd := test.MustRunMainWithCluster(t, 1)[0]
hostport := cmd.Server.URI.HostPort()
cm.Host = hostport
cm.Host = cmd.Server.URI.HostPort()
http.DefaultClient.Do(MustNewHTTPRequest("POST", "http://"+hostport+"/index/i", strings.NewReader("")))
http.DefaultClient.Do(MustNewHTTPRequest("POST", "http://"+hostport+"/index/i/field/f", strings.NewReader(`{"options":{"type": "int", "min": 0, "max": 100}}`)))
http.DefaultClient.Do(MustNewHTTPRequest("POST", "http://"+cm.Host+"/index/i", strings.NewReader("")))
http.DefaultClient.Do(MustNewHTTPRequest("POST", "http://"+cm.Host+"/index/i/field/f", strings.NewReader(`{"options":{"type": "int", "min": 0, "max": 100}}`)))
cm.Index = "i"
cm.Field = "f"

View file

@ -46,13 +46,6 @@ func NewHandler(opts ...http.HandlerOption) (*Handler, error) {
Handler: handler,
}
//h.API, err = pilosa.NewAPI(OptAPIServer(s))
if err != nil {
return nil, err
}
h.Handler.API = h.API
h.Handler.API.Executor = &h.Executor
// Handler test messages can no-op.
h.API.Broadcaster = pilosa.NopBroadcaster