Skip to content

Commit

Permalink
remove: unnecessary interface changes
Browse files Browse the repository at this point in the history
  • Loading branch information
Integralist committed Jan 23, 2025
1 parent 9a04147 commit c876f93
Show file tree
Hide file tree
Showing 3 changed files with 1 addition and 31 deletions.
5 changes: 0 additions & 5 deletions pkg/api/interface.go
Original file line number Diff line number Diff line change
Expand Up @@ -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)

Expand Down
1 change: 1 addition & 0 deletions pkg/app/run_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -72,6 +72,7 @@ dashboard
dictionary
dictionary-entry
domain
domain-v1
healthcheck
install
ip-list
Expand Down
26 changes: 0 additions & 26 deletions pkg/mock/api.go
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,6 @@ package mock

import (
"crypto/ed25519"
"net/http"

"github.com/fastly/go-fastly/v9/fastly"
)
Expand All @@ -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)

Expand Down Expand Up @@ -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()
Expand Down

0 comments on commit c876f93

Please sign in to comment.