From c876f9331b2c66d20d065b2959458e4147facafd Mon Sep 17 00:00:00 2001 From: Integralist Date: Thu, 23 Jan 2025 11:44:03 +0000 Subject: [PATCH] remove: unnecessary interface changes --- pkg/api/interface.go | 5 ----- pkg/app/run_test.go | 1 + pkg/mock/api.go | 26 -------------------------- 3 files changed, 1 insertion(+), 31 deletions(-) diff --git a/pkg/api/interface.go b/pkg/api/interface.go index 6a1c527f0..67fb76f82 100644 --- a/pkg/api/interface.go +++ b/pkg/api/interface.go @@ -18,11 +18,6 @@ type HTTPClient interface { // Interface models the methods of the Fastly API client that we use. // It exists to allow for easier testing, in combination with Mock. type Interface interface { - Delete(p string, ro *fastly.RequestOptions) (*http.Response, error) - Get(p string, ro *fastly.RequestOptions) (*http.Response, error) - PatchJSON(p string, i any, ro *fastly.RequestOptions) (*http.Response, error) - PostJSON(p string, i any, ro *fastly.RequestOptions) (*http.Response, error) - AllIPs() (v4, v6 fastly.IPAddrs, err error) AllDatacenters() (datacenters []fastly.Datacenter, err error) diff --git a/pkg/app/run_test.go b/pkg/app/run_test.go index c9d3a53cc..09100aa81 100644 --- a/pkg/app/run_test.go +++ b/pkg/app/run_test.go @@ -72,6 +72,7 @@ dashboard dictionary dictionary-entry domain +domain-v1 healthcheck install ip-list diff --git a/pkg/mock/api.go b/pkg/mock/api.go index 32afe5420..4633c4b95 100644 --- a/pkg/mock/api.go +++ b/pkg/mock/api.go @@ -2,7 +2,6 @@ package mock import ( "crypto/ed25519" - "net/http" "github.com/fastly/go-fastly/v9/fastly" ) @@ -11,11 +10,6 @@ import ( // The zero value is useful, but will panic on all methods. Provide function // implementations for the method(s) your test will call. type API struct { - DeleteFn func(string, *fastly.RequestOptions) (*http.Response, error) - GetFn func(string, *fastly.RequestOptions) (*http.Response, error) - PatchJSONFn func(string, any, *fastly.RequestOptions) (*http.Response, error) - PostJSONFn func(string, any, *fastly.RequestOptions) (*http.Response, error) - AllDatacentersFn func() (datacenters []fastly.Datacenter, err error) AllIPsFn func() (v4, v6 fastly.IPAddrs, err error) @@ -412,26 +406,6 @@ type API struct { DeleteObservabilityCustomDashboardFn func(i *fastly.DeleteObservabilityCustomDashboardInput) error } -// Delete implements Interface. -func (m API) Delete(p string, ro *fastly.RequestOptions) (*http.Response, error) { - return m.DeleteFn(p, ro) -} - -// Get implements Interface. -func (m API) Get(p string, ro *fastly.RequestOptions) (*http.Response, error) { - return m.GetFn(p, ro) -} - -// PatchJSON implements Interface. -func (m API) PatchJSON(p string, i any, ro *fastly.RequestOptions) (*http.Response, error) { - return m.PatchJSONFn(p, i, ro) -} - -// PostJSON implements Interface. -func (m API) PostJSON(p string, i any, ro *fastly.RequestOptions) (*http.Response, error) { - return m.PostJSONFn(p, i, ro) -} - // AllDatacenters implements Interface. func (m API) AllDatacenters() ([]fastly.Datacenter, error) { return m.AllDatacentersFn()