mirror of
https://github.com/k8sgpt-ai/k8sgpt.git
synced 2026-05-14 02:45:04 +00:00
25 lines
648 B
Go
25 lines
648 B
Go
package server
|
|
|
|
import (
|
|
"context"
|
|
|
|
schemav1 "buf.build/gen/go/k8sgpt-ai/k8sgpt/protocolbuffers/go/schema/v1"
|
|
"github.com/k8sgpt-ai/k8sgpt/pkg/integration"
|
|
)
|
|
|
|
func (*handler) ListIntegrations(ctx context.Context, req *schemav1.ListIntegrationsRequest) (*schemav1.ListIntegrationsResponse, error) {
|
|
|
|
integrationProvider := integration.NewIntegration()
|
|
integrations := integrationProvider.List()
|
|
resp := &schemav1.ListIntegrationsResponse{
|
|
Integrations: make([]string, 0),
|
|
}
|
|
for _, i := range integrations {
|
|
b, _ := integrationProvider.IsActivate(i)
|
|
if b {
|
|
resp.Integrations = append(resp.Integrations, i)
|
|
}
|
|
}
|
|
return resp, nil
|
|
}
|