From dc4a9b18a328df78b1c30dde76a6d444f261c53c Mon Sep 17 00:00:00 2001 From: Peter Kurfer Date: Wed, 13 Jan 2021 18:07:04 +0100 Subject: [PATCH] Moved endpoint handlers in tree --- cmd/inetmock/main.go | 10 +++++----- internal/app/app.go | 10 +++++----- internal/cmd/server.go | 20 +++++++++---------- internal/{endpoints => endpoint}/constants.go | 2 +- internal/{endpoints => endpoint}/endpoint.go | 2 +- .../endpoint_manager.go | 2 +- .../endpoint_manager_test.go | 2 +- .../endpoint/handler/dns/mock}/fallback.go | 2 +- .../handler/dns/mock}/fallback_test.go | 2 +- .../endpoint/handler/dns/mock}/handler.go | 2 +- .../handler/dns/mock}/protocol_options.go | 2 +- .../handler/dns/mock}/regex_handler.go | 2 +- .../endpoint/handler/dns/mock}/register.go | 2 +- .../handler/http/mock}/conn_context.go | 2 +- .../endpoint/handler/http/mock}/handler.go | 2 +- .../handler/http/mock}/handler_test.go | 6 +++--- .../handler/http/mock}/protocol_options.go | 2 +- .../http/mock}/protocol_options_test.go | 2 +- .../handler/http/mock}/regex_router.go | 2 +- .../endpoint/handler/http/mock}/register.go | 2 +- .../endpoint/handler/http/proxy}/handler.go | 2 +- .../handler/http/proxy}/protocol_options.go | 2 +- .../handler/http/proxy}/proxy_handler.go | 2 +- .../endpoint/handler/http/proxy}/register.go | 2 +- .../endpoint/handler/metrics}/handler.go | 2 +- .../handler/metrics}/protocol_options.go | 2 +- .../endpoint/handler/metrics}/register.go | 2 +- .../handler/tls/interceptor}/handler.go | 2 +- .../tls/interceptor}/protocol_options.go | 2 +- .../handler/tls/interceptor}/proxy.go | 2 +- .../handler/tls/interceptor}/proxy_conn.go | 2 +- .../handler/tls/interceptor}/register.go | 2 +- internal/rpc/endpoints_server.go | 8 ++++---- 33 files changed, 55 insertions(+), 55 deletions(-) rename internal/{endpoints => endpoint}/constants.go (77%) rename internal/{endpoints => endpoint}/endpoint.go (98%) rename internal/{endpoints => endpoint}/endpoint_manager.go (99%) rename internal/{endpoints => endpoint}/endpoint_manager_test.go (99%) rename {plugins/dns_mock => internal/endpoint/handler/dns/mock}/fallback.go (98%) rename {plugins/dns_mock => internal/endpoint/handler/dns/mock}/fallback_test.go (99%) rename {plugins/dns_mock => internal/endpoint/handler/dns/mock}/handler.go (99%) rename {plugins/dns_mock => internal/endpoint/handler/dns/mock}/protocol_options.go (98%) rename {plugins/dns_mock => internal/endpoint/handler/dns/mock}/regex_handler.go (99%) rename {plugins/dns_mock => internal/endpoint/handler/dns/mock}/register.go (98%) rename {plugins/http_mock => internal/endpoint/handler/http/mock}/conn_context.go (97%) rename {plugins/http_mock => internal/endpoint/handler/http/mock}/handler.go (98%) rename {plugins/http_mock => internal/endpoint/handler/http/mock}/handler_test.go (95%) rename {plugins/http_mock => internal/endpoint/handler/http/mock}/protocol_options.go (99%) rename {plugins/http_mock => internal/endpoint/handler/http/mock}/protocol_options_test.go (99%) rename {plugins/http_mock => internal/endpoint/handler/http/mock}/regex_router.go (99%) rename {plugins/http_mock => internal/endpoint/handler/http/mock}/register.go (97%) rename {plugins/http_proxy => internal/endpoint/handler/http/proxy}/handler.go (98%) rename {plugins/http_proxy => internal/endpoint/handler/http/proxy}/protocol_options.go (92%) rename {plugins/http_proxy => internal/endpoint/handler/http/proxy}/proxy_handler.go (99%) rename {plugins/http_proxy => internal/endpoint/handler/http/proxy}/register.go (98%) rename {plugins/metrics_exporter => internal/endpoint/handler/metrics}/handler.go (97%) rename {plugins/metrics_exporter => internal/endpoint/handler/metrics}/protocol_options.go (68%) rename {plugins/metrics_exporter => internal/endpoint/handler/metrics}/register.go (94%) rename {plugins/tls_interceptor => internal/endpoint/handler/tls/interceptor}/handler.go (99%) rename {plugins/tls_interceptor => internal/endpoint/handler/tls/interceptor}/protocol_options.go (91%) rename {plugins/tls_interceptor => internal/endpoint/handler/tls/interceptor}/proxy.go (97%) rename {plugins/tls_interceptor => internal/endpoint/handler/tls/interceptor}/proxy_conn.go (94%) rename {plugins/tls_interceptor => internal/endpoint/handler/tls/interceptor}/register.go (98%) diff --git a/cmd/inetmock/main.go b/cmd/inetmock/main.go index f478e04..38cf492 100644 --- a/cmd/inetmock/main.go +++ b/cmd/inetmock/main.go @@ -2,11 +2,11 @@ package main import ( "gitlab.com/inetmock/inetmock/internal/cmd" - _ "gitlab.com/inetmock/inetmock/plugins/dns_mock" - _ "gitlab.com/inetmock/inetmock/plugins/http_mock" - _ "gitlab.com/inetmock/inetmock/plugins/http_proxy" - _ "gitlab.com/inetmock/inetmock/plugins/metrics_exporter" - _ "gitlab.com/inetmock/inetmock/plugins/tls_interceptor" + _ "gitlab.com/inetmock/inetmock/internal/endpoint/handler/dns/mock" + _ "gitlab.com/inetmock/inetmock/internal/endpoint/handler/http/mock" + _ "gitlab.com/inetmock/inetmock/internal/endpoint/handler/http/proxy" + _ "gitlab.com/inetmock/inetmock/internal/endpoint/handler/metrics" + _ "gitlab.com/inetmock/inetmock/internal/endpoint/handler/tls/interceptor" ) func main() { diff --git a/internal/app/app.go b/internal/app/app.go index 2b17ec1..f906795 100644 --- a/internal/app/app.go +++ b/internal/app/app.go @@ -9,7 +9,7 @@ import ( "syscall" "github.com/spf13/cobra" - "gitlab.com/inetmock/inetmock/internal/endpoints" + "gitlab.com/inetmock/inetmock/internal/endpoint" "gitlab.com/inetmock/inetmock/pkg/api" "gitlab.com/inetmock/inetmock/pkg/audit" "gitlab.com/inetmock/inetmock/pkg/audit/sink" @@ -31,7 +31,7 @@ type App interface { api.PluginContext Config() config.Config Checker() health.Checker - EndpointManager() endpoints.EndpointManager + EndpointManager() endpoint.EndpointManager HandlerRegistry() api.HandlerRegistry Context() context.Context MustRun() @@ -45,7 +45,7 @@ type app struct { rootLogger logging.Logger certStore cert.Store checker health.Checker - endpointManager endpoints.EndpointManager + endpointManager endpoint.EndpointManager registry api.HandlerRegistry ctx context.Context cancel context.CancelFunc @@ -81,7 +81,7 @@ func (a app) Checker() health.Checker { return a.checker } -func (a app) EndpointManager() endpoints.EndpointManager { +func (a app) EndpointManager() endpoint.EndpointManager { return a.endpointManager } @@ -144,7 +144,7 @@ func NewApp(registrations ...api.Registration) (inetmockApp App, err error) { return } - a.endpointManager = endpoints.NewEndpointManager( + a.endpointManager = endpoint.NewEndpointManager( a.registry, a.Logger().Named("EndpointManager"), a.checker, diff --git a/internal/cmd/server.go b/internal/cmd/server.go index b182b88..d3d9bc1 100644 --- a/internal/cmd/server.go +++ b/internal/cmd/server.go @@ -5,11 +5,11 @@ import ( "os" "gitlab.com/inetmock/inetmock/internal/app" - "gitlab.com/inetmock/inetmock/plugins/dns_mock" - "gitlab.com/inetmock/inetmock/plugins/http_mock" - "gitlab.com/inetmock/inetmock/plugins/http_proxy" - "gitlab.com/inetmock/inetmock/plugins/metrics_exporter" - "gitlab.com/inetmock/inetmock/plugins/tls_interceptor" + "gitlab.com/inetmock/inetmock/internal/endpoint/handler/dns/mock" + mock2 "gitlab.com/inetmock/inetmock/internal/endpoint/handler/http/mock" + "gitlab.com/inetmock/inetmock/internal/endpoint/handler/http/proxy" + "gitlab.com/inetmock/inetmock/internal/endpoint/handler/metrics" + "gitlab.com/inetmock/inetmock/internal/endpoint/handler/tls/interceptor" ) var ( @@ -19,11 +19,11 @@ var ( func ExecuteServerCommand() { var err error if server, err = app.NewApp( - http_mock.AddHTTPMock, - dns_mock.AddDNSMock, - tls_interceptor.AddTLSInterceptor, - http_proxy.AddHTTPProxy, - metrics_exporter.AddMetricsExporter, + mock2.AddHTTPMock, + mock.AddDNSMock, + interceptor.AddTLSInterceptor, + proxy.AddHTTPProxy, + metrics.AddMetricsExporter, ); err != nil { fmt.Println(err.Error()) os.Exit(1) diff --git a/internal/endpoints/constants.go b/internal/endpoint/constants.go similarity index 77% rename from internal/endpoints/constants.go rename to internal/endpoint/constants.go index 1e9f681..b7379eb 100644 --- a/internal/endpoints/constants.go +++ b/internal/endpoint/constants.go @@ -1,4 +1,4 @@ -package endpoints +package endpoint import "time" diff --git a/internal/endpoints/endpoint.go b/internal/endpoint/endpoint.go similarity index 98% rename from internal/endpoints/endpoint.go rename to internal/endpoint/endpoint.go index f27068b..9dd314a 100644 --- a/internal/endpoints/endpoint.go +++ b/internal/endpoint/endpoint.go @@ -1,5 +1,5 @@ //go:generate mockgen -source=$GOFILE -destination=./../../internal/mock/endpoints/endpoint.mock.go -package=endpoints_mock -package endpoints +package endpoint import ( "context" diff --git a/internal/endpoints/endpoint_manager.go b/internal/endpoint/endpoint_manager.go similarity index 99% rename from internal/endpoints/endpoint_manager.go rename to internal/endpoint/endpoint_manager.go index 0470f8d..2da4be2 100644 --- a/internal/endpoints/endpoint_manager.go +++ b/internal/endpoint/endpoint_manager.go @@ -1,4 +1,4 @@ -package endpoints +package endpoint import ( "context" diff --git a/internal/endpoints/endpoint_manager_test.go b/internal/endpoint/endpoint_manager_test.go similarity index 99% rename from internal/endpoints/endpoint_manager_test.go rename to internal/endpoint/endpoint_manager_test.go index 0e49092..0c71cf4 100644 --- a/internal/endpoints/endpoint_manager_test.go +++ b/internal/endpoint/endpoint_manager_test.go @@ -1,4 +1,4 @@ -package endpoints +package endpoint import ( "reflect" diff --git a/plugins/dns_mock/fallback.go b/internal/endpoint/handler/dns/mock/fallback.go similarity index 98% rename from plugins/dns_mock/fallback.go rename to internal/endpoint/handler/dns/mock/fallback.go index 43697b1..8fb39a8 100644 --- a/plugins/dns_mock/fallback.go +++ b/internal/endpoint/handler/dns/mock/fallback.go @@ -1,4 +1,4 @@ -package dns_mock +package mock import ( "encoding/binary" diff --git a/plugins/dns_mock/fallback_test.go b/internal/endpoint/handler/dns/mock/fallback_test.go similarity index 99% rename from plugins/dns_mock/fallback_test.go rename to internal/endpoint/handler/dns/mock/fallback_test.go index a1996b3..33622be 100644 --- a/plugins/dns_mock/fallback_test.go +++ b/internal/endpoint/handler/dns/mock/fallback_test.go @@ -1,4 +1,4 @@ -package dns_mock +package mock import ( "net" diff --git a/plugins/dns_mock/handler.go b/internal/endpoint/handler/dns/mock/handler.go similarity index 99% rename from plugins/dns_mock/handler.go rename to internal/endpoint/handler/dns/mock/handler.go index 0f9d372..5e05432 100644 --- a/plugins/dns_mock/handler.go +++ b/internal/endpoint/handler/dns/mock/handler.go @@ -1,4 +1,4 @@ -package dns_mock +package mock import ( "context" diff --git a/plugins/dns_mock/protocol_options.go b/internal/endpoint/handler/dns/mock/protocol_options.go similarity index 98% rename from plugins/dns_mock/protocol_options.go rename to internal/endpoint/handler/dns/mock/protocol_options.go index f3aabc6..ea74351 100644 --- a/plugins/dns_mock/protocol_options.go +++ b/internal/endpoint/handler/dns/mock/protocol_options.go @@ -1,4 +1,4 @@ -package dns_mock +package mock import ( "net" diff --git a/plugins/dns_mock/regex_handler.go b/internal/endpoint/handler/dns/mock/regex_handler.go similarity index 99% rename from plugins/dns_mock/regex_handler.go rename to internal/endpoint/handler/dns/mock/regex_handler.go index 80dcb6a..64905b0 100644 --- a/plugins/dns_mock/regex_handler.go +++ b/internal/endpoint/handler/dns/mock/regex_handler.go @@ -1,4 +1,4 @@ -package dns_mock +package mock import ( "net" diff --git a/plugins/dns_mock/register.go b/internal/endpoint/handler/dns/mock/register.go similarity index 98% rename from plugins/dns_mock/register.go rename to internal/endpoint/handler/dns/mock/register.go index feedf31..312f3e6 100644 --- a/plugins/dns_mock/register.go +++ b/internal/endpoint/handler/dns/mock/register.go @@ -1,4 +1,4 @@ -package dns_mock +package mock import ( "github.com/prometheus/client_golang/prometheus" diff --git a/plugins/http_mock/conn_context.go b/internal/endpoint/handler/http/mock/conn_context.go similarity index 97% rename from plugins/http_mock/conn_context.go rename to internal/endpoint/handler/http/mock/conn_context.go index b22af86..502d104 100644 --- a/plugins/http_mock/conn_context.go +++ b/internal/endpoint/handler/http/mock/conn_context.go @@ -1,4 +1,4 @@ -package http_mock +package mock import ( "context" diff --git a/plugins/http_mock/handler.go b/internal/endpoint/handler/http/mock/handler.go similarity index 98% rename from plugins/http_mock/handler.go rename to internal/endpoint/handler/http/mock/handler.go index f1acb23..486b22e 100644 --- a/plugins/http_mock/handler.go +++ b/internal/endpoint/handler/http/mock/handler.go @@ -1,4 +1,4 @@ -package http_mock +package mock import ( "context" diff --git a/plugins/http_mock/handler_test.go b/internal/endpoint/handler/http/mock/handler_test.go similarity index 95% rename from plugins/http_mock/handler_test.go rename to internal/endpoint/handler/http/mock/handler_test.go index 804943a..e23bbf7 100644 --- a/plugins/http_mock/handler_test.go +++ b/internal/endpoint/handler/http/mock/handler_test.go @@ -1,4 +1,4 @@ -package http_mock_test +package mock_test import ( "context" @@ -13,12 +13,12 @@ import ( "github.com/golang/mock/gomock" "github.com/spf13/viper" + "gitlab.com/inetmock/inetmock/internal/endpoint/handler/http/mock" api_mock "gitlab.com/inetmock/inetmock/internal/mock/api" audit_mock "gitlab.com/inetmock/inetmock/internal/mock/audit" "gitlab.com/inetmock/inetmock/pkg/api" "gitlab.com/inetmock/inetmock/pkg/config" "gitlab.com/inetmock/inetmock/pkg/logging" - "gitlab.com/inetmock/inetmock/plugins/http_mock" "go.uber.org/zap" ) @@ -65,7 +65,7 @@ func setupHandler(b *testing.B, ctrl *gomock.Controller, listenPort uint16) (api b.Helper() registry := api.NewHandlerRegistry() - if err := http_mock.AddHTTPMock(registry); err != nil { + if err := mock.AddHTTPMock(registry); err != nil { b.Errorf("AddHTTPMock() error = %v", err) } handler, ok := registry.HandlerForName("http_mock") diff --git a/plugins/http_mock/protocol_options.go b/internal/endpoint/handler/http/mock/protocol_options.go similarity index 99% rename from plugins/http_mock/protocol_options.go rename to internal/endpoint/handler/http/mock/protocol_options.go index a702ee5..cca7a4d 100644 --- a/plugins/http_mock/protocol_options.go +++ b/internal/endpoint/handler/http/mock/protocol_options.go @@ -1,5 +1,5 @@ //go:generate go-enum -f $GOFILE --lower --marshal --names -package http_mock +package mock import ( "net/http" diff --git a/plugins/http_mock/protocol_options_test.go b/internal/endpoint/handler/http/mock/protocol_options_test.go similarity index 99% rename from plugins/http_mock/protocol_options_test.go rename to internal/endpoint/handler/http/mock/protocol_options_test.go index e992c2f..e56bc7e 100644 --- a/plugins/http_mock/protocol_options_test.go +++ b/internal/endpoint/handler/http/mock/protocol_options_test.go @@ -1,4 +1,4 @@ -package http_mock +package mock import ( "path/filepath" diff --git a/plugins/http_mock/regex_router.go b/internal/endpoint/handler/http/mock/regex_router.go similarity index 99% rename from plugins/http_mock/regex_router.go rename to internal/endpoint/handler/http/mock/regex_router.go index f9af3c9..4e96329 100644 --- a/plugins/http_mock/regex_router.go +++ b/internal/endpoint/handler/http/mock/regex_router.go @@ -1,4 +1,4 @@ -package http_mock +package mock import ( "net/http" diff --git a/plugins/http_mock/register.go b/internal/endpoint/handler/http/mock/register.go similarity index 97% rename from plugins/http_mock/register.go rename to internal/endpoint/handler/http/mock/register.go index d81e055..b84738f 100644 --- a/plugins/http_mock/register.go +++ b/internal/endpoint/handler/http/mock/register.go @@ -1,4 +1,4 @@ -package http_mock +package mock import ( "github.com/prometheus/client_golang/prometheus" diff --git a/plugins/http_proxy/handler.go b/internal/endpoint/handler/http/proxy/handler.go similarity index 98% rename from plugins/http_proxy/handler.go rename to internal/endpoint/handler/http/proxy/handler.go index 251a43e..3eef03a 100644 --- a/plugins/http_proxy/handler.go +++ b/internal/endpoint/handler/http/proxy/handler.go @@ -1,4 +1,4 @@ -package http_proxy +package proxy import ( "context" diff --git a/plugins/http_proxy/protocol_options.go b/internal/endpoint/handler/http/proxy/protocol_options.go similarity index 92% rename from plugins/http_proxy/protocol_options.go rename to internal/endpoint/handler/http/proxy/protocol_options.go index 5ec23eb..3dbf34c 100644 --- a/plugins/http_proxy/protocol_options.go +++ b/internal/endpoint/handler/http/proxy/protocol_options.go @@ -1,4 +1,4 @@ -package http_proxy +package proxy import ( "fmt" diff --git a/plugins/http_proxy/proxy_handler.go b/internal/endpoint/handler/http/proxy/proxy_handler.go similarity index 99% rename from plugins/http_proxy/proxy_handler.go rename to internal/endpoint/handler/http/proxy/proxy_handler.go index 9bf6ccb..d7af5b8 100644 --- a/plugins/http_proxy/proxy_handler.go +++ b/internal/endpoint/handler/http/proxy/proxy_handler.go @@ -1,4 +1,4 @@ -package http_proxy +package proxy import ( "context" diff --git a/plugins/http_proxy/register.go b/internal/endpoint/handler/http/proxy/register.go similarity index 98% rename from plugins/http_proxy/register.go rename to internal/endpoint/handler/http/proxy/register.go index cd743e5..4470caf 100644 --- a/plugins/http_proxy/register.go +++ b/internal/endpoint/handler/http/proxy/register.go @@ -1,4 +1,4 @@ -package http_proxy +package proxy import ( "github.com/prometheus/client_golang/prometheus" diff --git a/plugins/metrics_exporter/handler.go b/internal/endpoint/handler/metrics/handler.go similarity index 97% rename from plugins/metrics_exporter/handler.go rename to internal/endpoint/handler/metrics/handler.go index 31aaac5..0519892 100644 --- a/plugins/metrics_exporter/handler.go +++ b/internal/endpoint/handler/metrics/handler.go @@ -1,4 +1,4 @@ -package metrics_exporter +package metrics import ( "context" diff --git a/plugins/metrics_exporter/protocol_options.go b/internal/endpoint/handler/metrics/protocol_options.go similarity index 68% rename from plugins/metrics_exporter/protocol_options.go rename to internal/endpoint/handler/metrics/protocol_options.go index 89de17c..b7b1aed 100644 --- a/plugins/metrics_exporter/protocol_options.go +++ b/internal/endpoint/handler/metrics/protocol_options.go @@ -1,4 +1,4 @@ -package metrics_exporter +package metrics type metricsExporterOptions struct { Route string diff --git a/plugins/metrics_exporter/register.go b/internal/endpoint/handler/metrics/register.go similarity index 94% rename from plugins/metrics_exporter/register.go rename to internal/endpoint/handler/metrics/register.go index f21fcf8..4fa3043 100644 --- a/plugins/metrics_exporter/register.go +++ b/internal/endpoint/handler/metrics/register.go @@ -1,4 +1,4 @@ -package metrics_exporter +package metrics import ( "gitlab.com/inetmock/inetmock/pkg/api" diff --git a/plugins/tls_interceptor/handler.go b/internal/endpoint/handler/tls/interceptor/handler.go similarity index 99% rename from plugins/tls_interceptor/handler.go rename to internal/endpoint/handler/tls/interceptor/handler.go index f5107a7..b180eb2 100644 --- a/plugins/tls_interceptor/handler.go +++ b/internal/endpoint/handler/tls/interceptor/handler.go @@ -1,4 +1,4 @@ -package tls_interceptor +package interceptor import ( "context" diff --git a/plugins/tls_interceptor/protocol_options.go b/internal/endpoint/handler/tls/interceptor/protocol_options.go similarity index 91% rename from plugins/tls_interceptor/protocol_options.go rename to internal/endpoint/handler/tls/interceptor/protocol_options.go index 097ec28..c0de849 100644 --- a/plugins/tls_interceptor/protocol_options.go +++ b/internal/endpoint/handler/tls/interceptor/protocol_options.go @@ -1,4 +1,4 @@ -package tls_interceptor +package interceptor import ( "fmt" diff --git a/plugins/tls_interceptor/proxy.go b/internal/endpoint/handler/tls/interceptor/proxy.go similarity index 97% rename from plugins/tls_interceptor/proxy.go rename to internal/endpoint/handler/tls/interceptor/proxy.go index 5017044..be5af4c 100644 --- a/plugins/tls_interceptor/proxy.go +++ b/internal/endpoint/handler/tls/interceptor/proxy.go @@ -1,4 +1,4 @@ -package tls_interceptor +package interceptor import ( "net" diff --git a/plugins/tls_interceptor/proxy_conn.go b/internal/endpoint/handler/tls/interceptor/proxy_conn.go similarity index 94% rename from plugins/tls_interceptor/proxy_conn.go rename to internal/endpoint/handler/tls/interceptor/proxy_conn.go index f7529d9..396d80f 100644 --- a/plugins/tls_interceptor/proxy_conn.go +++ b/internal/endpoint/handler/tls/interceptor/proxy_conn.go @@ -1,4 +1,4 @@ -package tls_interceptor +package interceptor import ( "fmt" diff --git a/plugins/tls_interceptor/register.go b/internal/endpoint/handler/tls/interceptor/register.go similarity index 98% rename from plugins/tls_interceptor/register.go rename to internal/endpoint/handler/tls/interceptor/register.go index e8ec9cb..6fcf3fc 100644 --- a/plugins/tls_interceptor/register.go +++ b/internal/endpoint/handler/tls/interceptor/register.go @@ -1,4 +1,4 @@ -package tls_interceptor +package interceptor import ( "sync" diff --git a/internal/rpc/endpoints_server.go b/internal/rpc/endpoints_server.go index 7fada0d..ff7fd7a 100644 --- a/internal/rpc/endpoints_server.go +++ b/internal/rpc/endpoints_server.go @@ -3,12 +3,12 @@ package rpc import ( "context" - "gitlab.com/inetmock/inetmock/internal/endpoints" + "gitlab.com/inetmock/inetmock/internal/endpoint" ) type endpointsServer struct { UnimplementedEndpointsServer - endpointsManager endpoints.EndpointManager + endpointsManager endpoint.EndpointManager } func (e endpointsServer) GetEndpoints(_ context.Context, _ *GetEndpointsRequest) (*GetEndpointsResponse, error) { @@ -18,7 +18,7 @@ func (e endpointsServer) GetEndpoints(_ context.Context, _ *GetEndpointsRequest) }, nil } -func rpcEndpointsFromEndpoints(eps []endpoints.Endpoint) *[]*Endpoint { +func rpcEndpointsFromEndpoints(eps []endpoint.Endpoint) *[]*Endpoint { out := make([]*Endpoint, 0) for _, ep := range eps { out = append(out, rpcEndpointFromEndpoint(ep)) @@ -26,7 +26,7 @@ func rpcEndpointsFromEndpoints(eps []endpoints.Endpoint) *[]*Endpoint { return &out } -func rpcEndpointFromEndpoint(ep endpoints.Endpoint) *Endpoint { +func rpcEndpointFromEndpoint(ep endpoint.Endpoint) *Endpoint { return &Endpoint{ Id: ep.Id().String(), Name: ep.Name(),