refactor: move mock APIs and services into mock module (#39)

This commit is contained in:
Daniel Moran
2021-04-26 09:51:27 -04:00
committed by GitHub
parent 7d6ea73c33
commit cf30ec4345
5 changed files with 112 additions and 87 deletions

View File

@ -0,0 +1,24 @@
package mock
import (
"context"
"net/http"
"github.com/influxdata/influx-cli/v2/internal/api"
)
var _ api.HealthApi = (*HealthApi)(nil)
type HealthApi struct {
GetHealthExecuteFn func(api.ApiGetHealthRequest) (api.HealthCheck, *http.Response, error)
}
func (p *HealthApi) GetHealth(context.Context) api.ApiGetHealthRequest {
return api.ApiGetHealthRequest{
ApiService: p,
}
}
func (p *HealthApi) GetHealthExecute(req api.ApiGetHealthRequest) (api.HealthCheck, *http.Response, error) {
return p.GetHealthExecuteFn(req)
}