diff --git a/cmd/process.go b/cmd/process.go index 8eea4e0..612eb28 100644 --- a/cmd/process.go +++ b/cmd/process.go @@ -79,21 +79,13 @@ func process(ctx context.Context, logger *zap.SugaredLogger) error { logger.Fatalw("failed to initialize events", "error", err) } - // subscriber, err := pubsub.NewSubscriber(ctx, events, engine, - // pubsub.WithLogger(logger), - // ) - // if err != nil { - // logger.Fatalw("unable to initialize subscriber", "error", err) - // } - server := &server.Server{ - Context: cx, - Debug: viper.GetBool("logging.debug"), - Echo: eSrv, - Locations: viper.GetStringSlice("event-locations"), - Logger: logger, - // SubscriberConfig: config.AppConfig.Events.Subscriber, - // Subscriber: subscriber, + Context: cx, + Debug: viper.GetBool("logging.debug"), + Echo: eSrv, + Locations: viper.GetStringSlice("event-locations"), + Logger: logger, + Connection: conn, ChangeTopics: viper.GetStringSlice("change-topics"), IPBlock: viper.GetString("ipblock"), } @@ -117,10 +109,6 @@ func process(ctx context.Context, logger *zap.SugaredLogger) error { server.IPAMClient = ipamclient.NewClient((viper.GetString("ipam-endpoint"))) } - server.Connection = conn - - // server.Publisher = pub - if err := server.Run(cx); err != nil { logger.Fatalw("failed starting server", "error", err) cancel() diff --git a/internal/config/config.go b/internal/config/config.go index 19fd5af..f49041a 100644 --- a/internal/config/config.go +++ b/internal/config/config.go @@ -19,11 +19,6 @@ var AppConfig struct { OIDC OIDCClientConfig } -// EventsConfig stores the configuration for a load-balancer-api events config -// type EventsConfig struct { -// events.Config `mapstructure:",squash"` -// } - // OIDCClientConfig stores the configuration for an OIDC client type OIDCClientConfig struct { Client oauth2x.Config diff --git a/internal/server/server.go b/internal/server/server.go index 6933778..b32a653 100644 --- a/internal/server/server.go +++ b/internal/server/server.go @@ -13,16 +13,15 @@ import ( // Server holds options for server connectivity and settings type Server struct { - APIClient *lbapi.Client - IPAMClient *ipamclient.Client - Context context.Context - Debug bool - Echo *echox.Server - IPBlock string - Locations []string - Logger *zap.SugaredLogger - Publisher *events.Publisher - // SubscriberConfig events.SubscriberConfig + APIClient *lbapi.Client + IPAMClient *ipamclient.Client + Context context.Context + Debug bool + Echo *echox.Server + IPBlock string + Locations []string + Logger *zap.SugaredLogger + Publisher *events.Publisher Connection events.Connection ChangeTopics []string