-
Notifications
You must be signed in to change notification settings - Fork 24
/
provide.go
26 lines (22 loc) · 906 Bytes
/
provide.go
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
package controlpoints
import (
"go.uber.org/fx"
"google.golang.org/grpc"
controlpointsv1 "github.com/fluxninja/aperture/v2/api/gen/proto/go/aperture/autoscale/kubernetes/controlpoints/v1"
"github.com/fluxninja/aperture/v2/pkg/net/grpcgateway"
)
// Module returns an fx.Option that provides the Kubernetes discovery module.
func Module() fx.Option {
return fx.Options(
fx.Provide(NewHandler),
fx.Invoke(
RegisterControlPointCacheService,
RegisterControlPointsHandler,
),
grpcgateway.RegisterHandler{Handler: controlpointsv1.RegisterAutoScaleKubernetesControlPointsServiceHandlerFromEndpoint}.Annotate(),
)
}
// RegisterControlPointCacheService registers the ControlPointCache service handler with the gRPC server.
func RegisterControlPointCacheService(handler *Handler, server *grpc.Server) {
controlpointsv1.RegisterAutoScaleKubernetesControlPointsServiceServer(server, handler)
}