diff --git a/caduceus.go b/caduceus.go index ee28feb6..360dc8e4 100644 --- a/caduceus.go +++ b/caduceus.go @@ -15,12 +15,13 @@ import ( _ "github.com/goschtalt/yaml-decoder" _ "github.com/goschtalt/yaml-encoder" "github.com/xmidt-org/ancla" + "github.com/xmidt-org/ancla/anclafx" "github.com/xmidt-org/arrange/arrangehttp" - anclahelper "github.com/xmidt-org/caduceus/internal/anclaHelper" "github.com/xmidt-org/caduceus/internal/client" "github.com/xmidt-org/caduceus/internal/handler" "github.com/xmidt-org/caduceus/internal/metrics" "github.com/xmidt-org/caduceus/internal/sink" + "github.com/xmidt-org/clortho/clorthofx" "github.com/xmidt-org/candlelight" "github.com/xmidt-org/sallust" @@ -158,13 +159,11 @@ func Caduceus(arguments []string, run bool) error { touchhttp.Provide(), metrics.Provide(), client.Provide(), - ancla.ProvideMetrics(), - ancla.ProvideListener(), - ancla.ProvideService(), + clorthofx.Provide(), + anclafx.Provide(), fx.Invoke( lifeCycle, - anclahelper.InitializeAncla, ), ) diff --git a/go.mod b/go.mod index 63f8c41a..1a16bd69 100644 --- a/go.mod +++ b/go.mod @@ -12,7 +12,7 @@ require ( github.com/prometheus/client_golang v1.19.1 github.com/satori/go.uuid v1.2.0 github.com/stretchr/testify v1.9.0 - github.com/xmidt-org/ancla v0.3.13-0.20240829173225-b3ef5ded0677 + github.com/xmidt-org/ancla v0.3.13-0.20241009144151-4779e9548d9e github.com/xmidt-org/arrange v0.5.1-0.20230914215531-f02b8651b631 github.com/xmidt-org/bascule v0.11.7 github.com/xmidt-org/candlelight v0.0.21 diff --git a/go.sum b/go.sum index 546512be..8c184651 100644 --- a/go.sum +++ b/go.sum @@ -1660,8 +1660,8 @@ github.com/xdg-go/scram v1.1.1/go.mod h1:RaEWvsqvNKKvBPvcKeFjrG2cJqOkHTiyTpzz23n github.com/xdg-go/stringprep v1.0.3/go.mod h1:W3f5j4i+9rC0kuIEJL0ky1VpHXQU3ocBgklLGvcBnW8= github.com/xhit/go-str2duration v1.2.0/go.mod h1:3cPSlfZlUHVlneIVfePFWcJZsuwf+P1v2SRTV4cUmp4= github.com/xiang90/probing v0.0.0-20190116061207-43a291ad63a2/go.mod h1:UETIi67q53MR2AWcXfiuqkDkRtnGDLqkBTpCHuJHxtU= -github.com/xmidt-org/ancla v0.3.13-0.20240829173225-b3ef5ded0677 h1:33wdhUFnjYH7RCwLuVnw6aDUwHxI/jpVxcOI7MUdtaM= -github.com/xmidt-org/ancla v0.3.13-0.20240829173225-b3ef5ded0677/go.mod h1:MRBmecVt4ECxqHU5FDzGNyBPeW4F2mWz6jQ3hpEIoA8= +github.com/xmidt-org/ancla v0.3.13-0.20241009144151-4779e9548d9e h1:7rhAB70rJL792vA0fcJxqN/ani55JecN2Oc4E3GOMV4= +github.com/xmidt-org/ancla v0.3.13-0.20241009144151-4779e9548d9e/go.mod h1:rFd0rT41jSNx7lzVkF7JkIPLgVOx9WlXpYG+yRg0Mw8= github.com/xmidt-org/argus v0.3.9/go.mod h1:mDFS44R704gl9Fif3gkfAyvnZa53SvMepmXjYWABPvk= github.com/xmidt-org/argus v0.3.10-0.20201105190057-402fede05764/go.mod h1:lnMCVB/i0gOlUOOd2WbzDDgzTEqP5TipzQ8xKIw+N/I= github.com/xmidt-org/argus v0.3.10-0.20201217204602-66f69b12c498/go.mod h1:lnMCVB/i0gOlUOOd2WbzDDgzTEqP5TipzQ8xKIw+N/I= diff --git a/internal/anclaHelper/anclaHelper.go b/internal/anclaHelper/anclaHelper.go deleted file mode 100644 index aa88ac66..00000000 --- a/internal/anclaHelper/anclaHelper.go +++ /dev/null @@ -1,39 +0,0 @@ -// SPDX-FileCopyrightText: 2024 Comcast Cable Communications Management, LLC -// SPDX-License-Identifier: Apache-2.0 -package anclahelper - -import ( - "context" - "fmt" - - "github.com/xmidt-org/ancla" - "github.com/xmidt-org/caduceus/internal/sink" - "github.com/xmidt-org/sallust" - "go.uber.org/fx" - "go.uber.org/zap" -) - -type In struct { - fx.In - Svc *ancla.ClientService - Listener ancla.ListenerConfig - Sink sink.Wrapper - LC fx.Lifecycle -} - -func InitializeAncla(in In) error { - - stopWatches, err := in.Svc.StartListener(in.Listener, setLoggerInContext(), in.Sink) - if err != nil { - return fmt.Errorf("webhook service start listener error: %v", err) - } - in.LC.Append(fx.StopHook(stopWatches)) - return nil - -} - -func setLoggerInContext() func(context.Context, *zap.Logger) context.Context { - return func(parent context.Context, logger *zap.Logger) context.Context { - return sallust.With(parent, logger) - } -}