2024-02-28 09:54:50 +05:30
|
|
|
package integrations
|
|
|
|
|
|
|
|
|
|
import (
|
|
|
|
|
"context"
|
|
|
|
|
|
2025-03-20 21:01:41 +05:30
|
|
|
"github.com/SigNoz/signoz/pkg/query-service/model"
|
2025-04-15 21:05:36 +05:30
|
|
|
"github.com/SigNoz/signoz/pkg/types"
|
2024-02-28 09:54:50 +05:30
|
|
|
)
|
|
|
|
|
|
|
|
|
|
type InstalledIntegrationsRepo interface {
|
2025-04-15 21:05:36 +05:30
|
|
|
list(ctx context.Context, orgId string) ([]types.InstalledIntegration, *model.ApiError)
|
2024-02-28 09:54:50 +05:30
|
|
|
|
|
|
|
|
get(
|
2025-04-15 21:05:36 +05:30
|
|
|
ctx context.Context, orgId string, integrationTypes []string,
|
|
|
|
|
) (map[string]types.InstalledIntegration, *model.ApiError)
|
2024-02-28 09:54:50 +05:30
|
|
|
|
|
|
|
|
upsert(
|
|
|
|
|
ctx context.Context,
|
2025-04-15 21:05:36 +05:30
|
|
|
orgId string,
|
|
|
|
|
integrationType string,
|
|
|
|
|
config types.InstalledIntegrationConfig,
|
|
|
|
|
) (*types.InstalledIntegration, *model.ApiError)
|
2024-02-28 09:54:50 +05:30
|
|
|
|
2025-04-15 21:05:36 +05:30
|
|
|
delete(ctx context.Context, orgId string, integrationType string) *model.ApiError
|
2024-02-28 09:54:50 +05:30
|
|
|
}
|
|
|
|
|
|
|
|
|
|
type AvailableIntegrationsRepo interface {
|
|
|
|
|
list(context.Context) ([]IntegrationDetails, *model.ApiError)
|
|
|
|
|
|
|
|
|
|
get(
|
2025-04-15 21:05:36 +05:30
|
|
|
ctx context.Context, integrationTypes []string,
|
2024-02-28 09:54:50 +05:30
|
|
|
) (map[string]IntegrationDetails, *model.ApiError)
|
|
|
|
|
|
|
|
|
|
// AvailableIntegrationsRepo implementations are expected to cache
|
|
|
|
|
// details of installed integrations for quick retrieval.
|
|
|
|
|
//
|
|
|
|
|
// For v0 only bundled integrations are available, later versions
|
|
|
|
|
// are expected to add methods in this interface for pinning installed
|
|
|
|
|
// integration details in local cache.
|
|
|
|
|
}
|