plugin-barman-cloud/internal/cnpgi/operator/start.go
Armando Ruocco 3f4759c47b
chore: scaffold (#2)
Signed-off-by: Armando Ruocco <armando.ruocco@enterprisedb.com>
2024-09-26 11:52:56 +02:00

25 lines
666 B
Go

package operator
import (
"context"
"github.com/cloudnative-pg/cnpg-i-machinery/pkg/pluginhelper/http"
"github.com/cloudnative-pg/cnpg-i/pkg/identity"
"github.com/cloudnative-pg/cnpg-i/pkg/reconciler"
"google.golang.org/grpc"
)
type CNPGI struct{}
func (c *CNPGI) Start(ctx context.Context) error {
cmd := http.CreateMainCmd(IdentityImplementation{}, func(server *grpc.Server) error {
// Register the declared implementations
identity.RegisterIdentityServer(server, IdentityImplementation{})
reconciler.RegisterReconcilerHooksServer(server, ReconcilerImplementation{})
return nil
})
cmd.Use = "plugin-operator"
return cmd.ExecuteContext(ctx)
}