From 12046ba53079b2e1f01c2c746d4f9199b220529b Mon Sep 17 00:00:00 2001 From: Alon Braymok <138359965+alonkeyval@users.noreply.github.com> Date: Mon, 21 Oct 2024 13:58:14 +0300 Subject: [PATCH 001/128] Refactor old ui to new product design (#1605) --- .vscode/launch.json | 131 +- frontend/Makefile | 2 + frontend/endpoints/applications.go | 47 +- frontend/endpoints/config.go | 10 +- frontend/endpoints/destinations.go | 3 +- frontend/endpoints/namespaces.go | 40 + frontend/endpoints/sources.go | 8 +- frontend/go.mod | 8 + frontend/go.sum | 30 +- frontend/gqlgen.yml | 62 + frontend/graph/conversions.go | 150 + frontend/graph/generated.go | 10937 ++++++++++++++++ frontend/graph/model/destination.go | 48 + frontend/graph/model/models_gen.go | 471 + frontend/graph/resolver.go | 7 + frontend/graph/schema.graphqls | 264 + frontend/graph/schema.resolvers.go | 655 + frontend/main.go | 12 +- .../destination_finder.go | 79 + .../destination_recognition/elasticsearch.go | 45 + .../destination_recognition/jaeger.go | 46 + frontend/services/destinations.go | 300 + frontend/services/namespaces.go | 190 + frontend/services/sources.go | 382 + .../services/test_connection/conversion.go | 58 + .../test_connection/otlp_test_connection.go | 37 + .../otlphttp_test_connection.go | 36 + .../test_connection/test_connection.go | 157 + frontend/services/test_connection/utils.go | 43 + .../services/test_connection/utils_test.go | 56 + frontend/services/utils.go | 50 + .../app/(setup)/choose-destination/page.tsx | 20 +- .../app/(setup)/choose-sources/page.tsx | 20 +- .../app/(setup)/connect-destination/page.tsx | 17 - frontend/webapp/app/(setup)/layout.tsx | 29 +- frontend/webapp/app/(setup)/styled.ts | 11 + frontend/webapp/app/(setup)/styled.tsx | 41 - frontend/webapp/app/globals.css | 4 + frontend/webapp/app/layout.tsx | 21 +- frontend/webapp/app/main/layout.tsx | 36 + frontend/webapp/app/main/page.tsx | 11 + frontend/webapp/app/page.tsx | 30 +- .../components/common/card-details/index.tsx | 41 + .../common/configured-fields/index.tsx | 78 + frontend/webapp/components/common/index.ts | 2 + .../add-destination-button/index.tsx | 33 + .../edit-destination-form/index.tsx | 45 + .../webapp/components/destinations/index.ts | 3 + .../destinations/monitors-tap-list/index.tsx | 53 + frontend/webapp/components/index.ts | 3 + .../components/main/header/cp-title/index.tsx | 51 + .../webapp/components/main/header/index.tsx | 45 + frontend/webapp/components/main/index.tsx | 1 + .../modals/delete-entity-modal/index.tsx | 73 + frontend/webapp/components/modals/index.tsx | 1 + .../create.connection.form.tsx | 11 +- .../components/setup/headers/header/index.tsx | 59 + .../webapp/components/setup/headers/index.tsx | 1 + frontend/webapp/components/setup/index.tsx | 1 + .../webapp/components/setup/menu/index.tsx | 147 + .../choose-action-modal/action-options.ts | 59 + .../actions/choose-action-modal/index.tsx | 92 + .../webapp/containers/main/actions/index.ts | 1 + .../add-destination-modal/index.tsx | 102 + .../choose-destination-menu/index.tsx | 90 + .../choose-destination-modal-body/index.tsx | 106 + .../configured-destinations-list/index.tsx | 199 + .../connection-notification.tsx | 30 + .../form-container.tsx | 50 + .../connect-destination-modal-body/index.tsx | 252 + .../destination-list-item/index.tsx | 121 + .../destinations-list/index.tsx | 77 + .../potential-destinations-list/index.tsx | 50 + .../dynamic-form-fields/index.tsx | 70 + .../destinations/add-destination/index.tsx | 102 + .../destinations/add-destination/styled.ts | 21 + .../add-destination/test-connection/index.tsx | 80 + .../destination-drawer-container/index.tsx | 99 + .../containers/main/destinations/index.tsx | 2 + .../main/overview/add-entity/index.tsx | 152 + .../webapp/containers/main/overview/index.ts | 1 + .../overview/overview-actions-menu/index.tsx | 57 + .../overview/overview-data-flow/index.tsx | 56 + .../overview-drawer/drawer-footer/index.tsx | 95 + .../overview-drawer/drawer-header/index.tsx | 122 + .../main/overview/overview-drawer/index.tsx | 233 + .../choose-source-modal/index.tsx | 99 + .../choose-sources-body/index.tsx | 136 + .../choose-sources-list/index.tsx | 130 + .../choose-sources-menu/index.ts | 2 + .../search-and-dropdown.tsx | 37 + .../toggles-and-checkboxes.tsx | 61 + .../choose-sources-menu/type.ts | 30 + .../main/sources/choose-sources/index.tsx | 54 + .../webapp/containers/main/sources/index.ts | 3 + .../sources/source-drawer-container/index.tsx | 31 + .../webapp/containers/setup/sources/index.tsx | 9 +- frontend/webapp/graphql/index.ts | 2 + .../webapp/graphql/mutations/destination.ts | 52 + frontend/webapp/graphql/mutations/index.ts | 3 + .../webapp/graphql/mutations/namespace.ts | 7 + frontend/webapp/graphql/mutations/source.ts | 22 + .../graphql/queries/compute-platform.ts | 78 + frontend/webapp/graphql/queries/config.ts | 10 + .../webapp/graphql/queries/destination.ts | 51 + frontend/webapp/graphql/queries/index.ts | 3 + frontend/webapp/hooks/actions/index.ts | 1 + .../webapp/hooks/actions/useGetActions.ts | 10 + frontend/webapp/hooks/common/index.ts | 1 + .../webapp/hooks/common/useContainerWidth.ts | 23 + .../webapp/hooks/compute-platform/index.ts | 2 + .../compute-platform/useComputePlatform.ts | 17 + .../hooks/compute-platform/useNamespace.ts | 44 + frontend/webapp/hooks/destinations/index.ts | 10 +- .../destinations/useActualDestinations.ts | 32 + .../hooks/destinations/useCheckConnection.ts | 29 - .../destinations/useConnectDestinationForm.ts | 87 + .../destinations/useCreateDestination.ts | 21 + .../destinations/useDestinationFormData.ts | 165 + .../hooks/destinations/useDestinationTypes.ts | 36 + .../useEditDestinationFormHandlers.ts | 22 + .../destinations/usePotentialDestinations.ts | 60 + .../hooks/destinations/useTestConnection.ts | 42 + .../destinations/useUpdateDestination.ts | 33 + frontend/webapp/hooks/index.tsx | 4 + frontend/webapp/hooks/new-config/index.ts | 1 + frontend/webapp/hooks/new-config/useConfig.ts | 16 + frontend/webapp/hooks/overview/index.tsx | 1 + .../hooks/overview/useNodeDataFlowHandlers.ts | 55 + frontend/webapp/hooks/setup/index.ts | 1 + frontend/webapp/hooks/setup/useConnectEnv.ts | 91 + frontend/webapp/hooks/sources/index.ts | 4 + .../webapp/hooks/sources/useActualSources.ts | 86 + .../hooks/sources/useConnectSourcesList.ts | 40 + .../sources/useConnectSourcesMenuState.ts | 107 + .../webapp/hooks/sources/usePersistSource.ts | 46 + .../webapp/hooks/sources/useUpdateSource.ts | 35 + frontend/webapp/hooks/useOnClickOutside.tsx | 23 +- frontend/webapp/lib/gql/apollo-wrapper.tsx | 54 + frontend/webapp/lib/gql/client.ts | 12 + frontend/webapp/lib/gql/index.ts | 1 + frontend/webapp/lib/index.ts | 1 + frontend/webapp/package.json | 12 +- frontend/webapp/public/brand/odigos-icon.svg | 5 + .../public/brand/transparent-logo-black.svg | 19 + .../public/brand/transparent-logo-white.svg | 19 + .../public/icons/actions/addclusterinfo.svg | 3 + .../public/icons/actions/deleteattribute.svg | 3 + .../public/icons/actions/piimasking.svg | 3 + .../public/icons/actions/renameattribute.svg | 3 + .../webapp/public/icons/actions/sampler.svg | 3 + .../public/icons/common/arrow-black.svg | 8 + .../public/icons/common/arrow-right.svg | 10 + .../public/icons/common/arrow-white.svg | 8 + frontend/webapp/public/icons/common/check.svg | 3 + .../icons/common/connection-succeeded.svg | 3 + frontend/webapp/public/icons/common/edit.svg | 3 + .../public/icons/common/extend-arrow.svg | 5 + .../webapp/public/icons/common/folder.svg | 3 + frontend/webapp/public/icons/common/index.ts | 3 + frontend/webapp/public/icons/common/info.svg | 3 + .../public/icons/common/no-data-found.svg | 3 + .../webapp/public/icons/common/plus-black.svg | 3 + frontend/webapp/public/icons/common/plus.svg | 3 + .../webapp/public/icons/common/search.svg | 3 + frontend/webapp/public/icons/common/trash.svg | 3 + frontend/webapp/public/icons/common/x.svg | 14 + frontend/webapp/public/icons/cp/k8s.svg | 4 + frontend/webapp/public/icons/index.ts | 1 + .../webapp/public/icons/monitors/logs.svg | 3 + .../webapp/public/icons/monitors/metrics.svg | 3 + .../webapp/public/icons/monitors/traces.svg | 3 + .../public/icons/notification/error-icon.svg | 3 + .../public/icons/notification/error-icon2.svg | 3 + .../icons/notification/success-icon.svg | 3 + .../icons/notification/warning-icon.svg | 3 + .../webapp/public/icons/overview/actions.svg | 3 + .../public/icons/overview/destinations.svg | 5 + .../webapp/public/icons/overview/overview.svg | 3 + .../webapp/public/icons/overview/sources.svg | 3 + .../auto-complete-input/index.tsx | 281 + .../reuseable-components/button/index.tsx | 123 + .../checkbox-list/index.tsx | 72 + .../reuseable-components/checkbox/index.tsx | 80 + .../connection-status/index.tsx | 89 + .../reuseable-components/counter/index.tsx | 46 + .../reuseable-components/divider/index.tsx | 36 + .../reuseable-components/drawer/index.tsx | 80 + .../reuseable-components/dropdown/index.tsx | 246 + .../fade-loader/helpers/animation.ts | 27 + .../fade-loader/helpers/unitConverter.ts | 77 + .../fade-loader/index.tsx | 137 + frontend/webapp/reuseable-components/index.ts | 26 + .../reuseable-components/input-list/index.tsx | 156 + .../reuseable-components/input/index.tsx | 222 + .../key-value-input-list/index.tsx | 189 + .../reuseable-components/modal/index.tsx | 139 + .../navigation-buttons/index.tsx | 90 + .../no-data-found/index.tsx | 54 + .../nodes-data-flow/builder.ts | 222 + .../nodes-data-flow/index.tsx | 39 + .../nodes-data-flow/nodes/add-action-node.tsx | 77 + .../nodes-data-flow/nodes/base-node.tsx | 167 + .../nodes-data-flow/nodes/header-node.tsx | 54 + .../notification-note/index.tsx | 145 + .../section-title/index.tsx | 64 + .../skeleton-loader/index.tsx | 66 + .../reuseable-components/tab-list/index.tsx | 82 + .../webapp/reuseable-components/tag/index.tsx | 62 + .../reuseable-components/text/index.tsx | 42 + .../reuseable-components/textarea/index.tsx | 157 + .../reuseable-components/toggle/index.tsx | 85 + .../reuseable-components/tooltip/index.tsx | 80 + frontend/webapp/store/index.ts | 5 +- frontend/webapp/store/slices/app-slice.ts | 25 - frontend/webapp/store/slices/index.ts | 1 - frontend/webapp/store/useAppStore.ts | 56 + frontend/webapp/store/useDrawerStore.tsx | 28 + .../webapp/styles/{palette.tsx => palette.ts} | 9 +- frontend/webapp/styles/theme.ts | 142 + frontend/webapp/types/actions.ts | 2 +- frontend/webapp/types/common.ts | 24 + frontend/webapp/types/compute-platform.ts | 22 + frontend/webapp/types/destinations.ts | 128 +- frontend/webapp/types/index.ts | 2 + frontend/webapp/types/namespace.ts | 4 + frontend/webapp/types/sources.ts | 33 + frontend/webapp/utils/constants/index.tsx | 1 + frontend/webapp/utils/constants/monitors.ts | 14 + .../utils/constants/programming-languages.ts | 92 + frontend/webapp/utils/constants/urls.tsx | 3 +- frontend/webapp/yarn.lock | 262 +- k8sutils/pkg/workload/workload.go | 48 + 233 files changed, 23844 insertions(+), 361 deletions(-) create mode 100644 frontend/Makefile create mode 100644 frontend/gqlgen.yml create mode 100644 frontend/graph/conversions.go create mode 100644 frontend/graph/generated.go create mode 100644 frontend/graph/model/destination.go create mode 100644 frontend/graph/model/models_gen.go create mode 100644 frontend/graph/resolver.go create mode 100644 frontend/graph/schema.graphqls create mode 100644 frontend/graph/schema.resolvers.go create mode 100644 frontend/services/destination_recognition/destination_finder.go create mode 100644 frontend/services/destination_recognition/elasticsearch.go create mode 100644 frontend/services/destination_recognition/jaeger.go create mode 100644 frontend/services/destinations.go create mode 100644 frontend/services/namespaces.go create mode 100644 frontend/services/sources.go create mode 100644 frontend/services/test_connection/conversion.go create mode 100644 frontend/services/test_connection/otlp_test_connection.go create mode 100644 frontend/services/test_connection/otlphttp_test_connection.go create mode 100644 frontend/services/test_connection/test_connection.go create mode 100644 frontend/services/test_connection/utils.go create mode 100644 frontend/services/test_connection/utils_test.go create mode 100644 frontend/services/utils.go delete mode 100644 frontend/webapp/app/(setup)/connect-destination/page.tsx create mode 100644 frontend/webapp/app/(setup)/styled.ts delete mode 100644 frontend/webapp/app/(setup)/styled.tsx create mode 100644 frontend/webapp/app/globals.css create mode 100644 frontend/webapp/app/main/layout.tsx create mode 100644 frontend/webapp/app/main/page.tsx create mode 100644 frontend/webapp/components/common/card-details/index.tsx create mode 100644 frontend/webapp/components/common/configured-fields/index.tsx create mode 100644 frontend/webapp/components/destinations/add-destination-button/index.tsx create mode 100644 frontend/webapp/components/destinations/edit-destination-form/index.tsx create mode 100644 frontend/webapp/components/destinations/index.ts create mode 100644 frontend/webapp/components/destinations/monitors-tap-list/index.tsx create mode 100644 frontend/webapp/components/main/header/cp-title/index.tsx create mode 100644 frontend/webapp/components/main/header/index.tsx create mode 100644 frontend/webapp/components/main/index.tsx create mode 100644 frontend/webapp/components/modals/delete-entity-modal/index.tsx create mode 100644 frontend/webapp/components/modals/index.tsx create mode 100644 frontend/webapp/components/setup/headers/header/index.tsx create mode 100644 frontend/webapp/components/setup/menu/index.tsx create mode 100644 frontend/webapp/containers/main/actions/choose-action-modal/action-options.ts create mode 100644 frontend/webapp/containers/main/actions/choose-action-modal/index.tsx create mode 100644 frontend/webapp/containers/main/destinations/add-destination/add-destination-modal/index.tsx create mode 100644 frontend/webapp/containers/main/destinations/add-destination/choose-destination-menu/index.tsx create mode 100644 frontend/webapp/containers/main/destinations/add-destination/choose-destination-modal-body/index.tsx create mode 100644 frontend/webapp/containers/main/destinations/add-destination/configured-destinations-list/index.tsx create mode 100644 frontend/webapp/containers/main/destinations/add-destination/connect-destination-modal-body/connection-notification.tsx create mode 100644 frontend/webapp/containers/main/destinations/add-destination/connect-destination-modal-body/form-container.tsx create mode 100644 frontend/webapp/containers/main/destinations/add-destination/connect-destination-modal-body/index.tsx create mode 100644 frontend/webapp/containers/main/destinations/add-destination/destinations-list/destination-list-item/index.tsx create mode 100644 frontend/webapp/containers/main/destinations/add-destination/destinations-list/index.tsx create mode 100644 frontend/webapp/containers/main/destinations/add-destination/destinations-list/potential-destinations-list/index.tsx create mode 100644 frontend/webapp/containers/main/destinations/add-destination/dynamic-form-fields/index.tsx create mode 100644 frontend/webapp/containers/main/destinations/add-destination/index.tsx create mode 100644 frontend/webapp/containers/main/destinations/add-destination/styled.ts create mode 100644 frontend/webapp/containers/main/destinations/add-destination/test-connection/index.tsx create mode 100644 frontend/webapp/containers/main/destinations/destination-drawer-container/index.tsx create mode 100644 frontend/webapp/containers/main/overview/add-entity/index.tsx create mode 100644 frontend/webapp/containers/main/overview/overview-actions-menu/index.tsx create mode 100644 frontend/webapp/containers/main/overview/overview-data-flow/index.tsx create mode 100644 frontend/webapp/containers/main/overview/overview-drawer/drawer-footer/index.tsx create mode 100644 frontend/webapp/containers/main/overview/overview-drawer/drawer-header/index.tsx create mode 100644 frontend/webapp/containers/main/overview/overview-drawer/index.tsx create mode 100644 frontend/webapp/containers/main/sources/choose-sources/choose-source-modal/index.tsx create mode 100644 frontend/webapp/containers/main/sources/choose-sources/choose-sources-body/index.tsx create mode 100644 frontend/webapp/containers/main/sources/choose-sources/choose-sources-list/index.tsx create mode 100644 frontend/webapp/containers/main/sources/choose-sources/choose-sources-menu/index.ts create mode 100644 frontend/webapp/containers/main/sources/choose-sources/choose-sources-menu/search-and-dropdown.tsx create mode 100644 frontend/webapp/containers/main/sources/choose-sources/choose-sources-menu/toggles-and-checkboxes.tsx create mode 100644 frontend/webapp/containers/main/sources/choose-sources/choose-sources-menu/type.ts create mode 100644 frontend/webapp/containers/main/sources/choose-sources/index.tsx create mode 100644 frontend/webapp/containers/main/sources/source-drawer-container/index.tsx create mode 100644 frontend/webapp/graphql/index.ts create mode 100644 frontend/webapp/graphql/mutations/destination.ts create mode 100644 frontend/webapp/graphql/mutations/index.ts create mode 100644 frontend/webapp/graphql/mutations/namespace.ts create mode 100644 frontend/webapp/graphql/mutations/source.ts create mode 100644 frontend/webapp/graphql/queries/compute-platform.ts create mode 100644 frontend/webapp/graphql/queries/config.ts create mode 100644 frontend/webapp/graphql/queries/destination.ts create mode 100644 frontend/webapp/graphql/queries/index.ts create mode 100644 frontend/webapp/hooks/actions/useGetActions.ts create mode 100644 frontend/webapp/hooks/common/index.ts create mode 100644 frontend/webapp/hooks/common/useContainerWidth.ts create mode 100644 frontend/webapp/hooks/compute-platform/index.ts create mode 100644 frontend/webapp/hooks/compute-platform/useComputePlatform.ts create mode 100644 frontend/webapp/hooks/compute-platform/useNamespace.ts create mode 100644 frontend/webapp/hooks/destinations/useActualDestinations.ts delete mode 100644 frontend/webapp/hooks/destinations/useCheckConnection.ts create mode 100644 frontend/webapp/hooks/destinations/useConnectDestinationForm.ts create mode 100644 frontend/webapp/hooks/destinations/useCreateDestination.ts create mode 100644 frontend/webapp/hooks/destinations/useDestinationFormData.ts create mode 100644 frontend/webapp/hooks/destinations/useDestinationTypes.ts create mode 100644 frontend/webapp/hooks/destinations/useEditDestinationFormHandlers.ts create mode 100644 frontend/webapp/hooks/destinations/usePotentialDestinations.ts create mode 100644 frontend/webapp/hooks/destinations/useTestConnection.ts create mode 100644 frontend/webapp/hooks/destinations/useUpdateDestination.ts create mode 100644 frontend/webapp/hooks/new-config/index.ts create mode 100644 frontend/webapp/hooks/new-config/useConfig.ts create mode 100644 frontend/webapp/hooks/overview/index.tsx create mode 100644 frontend/webapp/hooks/overview/useNodeDataFlowHandlers.ts create mode 100644 frontend/webapp/hooks/setup/useConnectEnv.ts create mode 100644 frontend/webapp/hooks/sources/useActualSources.ts create mode 100644 frontend/webapp/hooks/sources/useConnectSourcesList.ts create mode 100644 frontend/webapp/hooks/sources/useConnectSourcesMenuState.ts create mode 100644 frontend/webapp/hooks/sources/usePersistSource.ts create mode 100644 frontend/webapp/hooks/sources/useUpdateSource.ts create mode 100644 frontend/webapp/lib/gql/apollo-wrapper.tsx create mode 100644 frontend/webapp/lib/gql/client.ts create mode 100644 frontend/webapp/lib/gql/index.ts create mode 100644 frontend/webapp/lib/index.ts create mode 100644 frontend/webapp/public/brand/odigos-icon.svg create mode 100644 frontend/webapp/public/brand/transparent-logo-black.svg create mode 100644 frontend/webapp/public/brand/transparent-logo-white.svg create mode 100644 frontend/webapp/public/icons/actions/addclusterinfo.svg create mode 100644 frontend/webapp/public/icons/actions/deleteattribute.svg create mode 100644 frontend/webapp/public/icons/actions/piimasking.svg create mode 100644 frontend/webapp/public/icons/actions/renameattribute.svg create mode 100644 frontend/webapp/public/icons/actions/sampler.svg create mode 100644 frontend/webapp/public/icons/common/arrow-black.svg create mode 100644 frontend/webapp/public/icons/common/arrow-right.svg create mode 100644 frontend/webapp/public/icons/common/arrow-white.svg create mode 100644 frontend/webapp/public/icons/common/check.svg create mode 100644 frontend/webapp/public/icons/common/connection-succeeded.svg create mode 100644 frontend/webapp/public/icons/common/edit.svg create mode 100644 frontend/webapp/public/icons/common/extend-arrow.svg create mode 100644 frontend/webapp/public/icons/common/folder.svg create mode 100644 frontend/webapp/public/icons/common/index.ts create mode 100644 frontend/webapp/public/icons/common/info.svg create mode 100644 frontend/webapp/public/icons/common/no-data-found.svg create mode 100644 frontend/webapp/public/icons/common/plus-black.svg create mode 100644 frontend/webapp/public/icons/common/plus.svg create mode 100644 frontend/webapp/public/icons/common/search.svg create mode 100644 frontend/webapp/public/icons/common/trash.svg create mode 100644 frontend/webapp/public/icons/common/x.svg create mode 100644 frontend/webapp/public/icons/cp/k8s.svg create mode 100644 frontend/webapp/public/icons/index.ts create mode 100644 frontend/webapp/public/icons/monitors/logs.svg create mode 100644 frontend/webapp/public/icons/monitors/metrics.svg create mode 100644 frontend/webapp/public/icons/monitors/traces.svg create mode 100644 frontend/webapp/public/icons/notification/error-icon.svg create mode 100644 frontend/webapp/public/icons/notification/error-icon2.svg create mode 100644 frontend/webapp/public/icons/notification/success-icon.svg create mode 100644 frontend/webapp/public/icons/notification/warning-icon.svg create mode 100644 frontend/webapp/public/icons/overview/actions.svg create mode 100644 frontend/webapp/public/icons/overview/destinations.svg create mode 100644 frontend/webapp/public/icons/overview/overview.svg create mode 100644 frontend/webapp/public/icons/overview/sources.svg create mode 100644 frontend/webapp/reuseable-components/auto-complete-input/index.tsx create mode 100644 frontend/webapp/reuseable-components/button/index.tsx create mode 100644 frontend/webapp/reuseable-components/checkbox-list/index.tsx create mode 100644 frontend/webapp/reuseable-components/checkbox/index.tsx create mode 100644 frontend/webapp/reuseable-components/connection-status/index.tsx create mode 100644 frontend/webapp/reuseable-components/counter/index.tsx create mode 100644 frontend/webapp/reuseable-components/divider/index.tsx create mode 100644 frontend/webapp/reuseable-components/drawer/index.tsx create mode 100644 frontend/webapp/reuseable-components/dropdown/index.tsx create mode 100644 frontend/webapp/reuseable-components/fade-loader/helpers/animation.ts create mode 100644 frontend/webapp/reuseable-components/fade-loader/helpers/unitConverter.ts create mode 100644 frontend/webapp/reuseable-components/fade-loader/index.tsx create mode 100644 frontend/webapp/reuseable-components/index.ts create mode 100644 frontend/webapp/reuseable-components/input-list/index.tsx create mode 100644 frontend/webapp/reuseable-components/input/index.tsx create mode 100644 frontend/webapp/reuseable-components/key-value-input-list/index.tsx create mode 100644 frontend/webapp/reuseable-components/modal/index.tsx create mode 100644 frontend/webapp/reuseable-components/navigation-buttons/index.tsx create mode 100644 frontend/webapp/reuseable-components/no-data-found/index.tsx create mode 100644 frontend/webapp/reuseable-components/nodes-data-flow/builder.ts create mode 100644 frontend/webapp/reuseable-components/nodes-data-flow/index.tsx create mode 100644 frontend/webapp/reuseable-components/nodes-data-flow/nodes/add-action-node.tsx create mode 100644 frontend/webapp/reuseable-components/nodes-data-flow/nodes/base-node.tsx create mode 100644 frontend/webapp/reuseable-components/nodes-data-flow/nodes/header-node.tsx create mode 100644 frontend/webapp/reuseable-components/notification-note/index.tsx create mode 100644 frontend/webapp/reuseable-components/section-title/index.tsx create mode 100644 frontend/webapp/reuseable-components/skeleton-loader/index.tsx create mode 100644 frontend/webapp/reuseable-components/tab-list/index.tsx create mode 100644 frontend/webapp/reuseable-components/tag/index.tsx create mode 100644 frontend/webapp/reuseable-components/text/index.tsx create mode 100644 frontend/webapp/reuseable-components/textarea/index.tsx create mode 100644 frontend/webapp/reuseable-components/toggle/index.tsx create mode 100644 frontend/webapp/reuseable-components/tooltip/index.tsx delete mode 100644 frontend/webapp/store/slices/app-slice.ts create mode 100644 frontend/webapp/store/useAppStore.ts create mode 100644 frontend/webapp/store/useDrawerStore.tsx rename frontend/webapp/styles/{palette.tsx => palette.ts} (86%) create mode 100644 frontend/webapp/styles/theme.ts create mode 100644 frontend/webapp/types/compute-platform.ts create mode 100644 frontend/webapp/types/namespace.ts create mode 100644 frontend/webapp/utils/constants/monitors.ts create mode 100644 frontend/webapp/utils/constants/programming-languages.ts diff --git a/.vscode/launch.json b/.vscode/launch.json index aec4ea6f8..a3ba143a6 100644 --- a/.vscode/launch.json +++ b/.vscode/launch.json @@ -1,64 +1,69 @@ { - "version": "0.2.0", - "configurations": [ - { - "name": "Remote Odiglet", - "type": "go", - "request": "attach", - "mode": "remote", - "debugAdapter": "legacy", - "port": 2345, - "host": "127.0.0.1", - "remotePath": "" - }, - { - "name": "instrumentor local", - "type": "go", - "request": "launch", - "mode": "debug", - "program": "${workspaceFolder}/instrumentor", - "cwd": "${workspaceFolder}/instrumentor", - "env": { - "LOCAL_MUTATING_WEBHOOK_CERT_DIR": "${workspaceFolder}/serving-certs" - } - }, - { - "name": "frontend", - "type": "go", - "request": "launch", - "mode": "debug", - "program": "${workspaceFolder}/frontend", - "cwd": "${workspaceFolder}/frontend", - "args": ["--port", "8085", "--address", "0.0.0.0"] - }, - { - "name": "autoscaler local", - "type": "go", - "request": "launch", - "mode": "debug", - "program": "${workspaceFolder}/autoscaler", - "cwd": "${workspaceFolder}/autoscaler", - "env": { - "ODIGOS_VERSION": "v1.0.90" - } - }, - { - "name": "scheduler local", - "type": "go", - "request": "launch", - "mode": "debug", - "program": "${workspaceFolder}/scheduler", - "cwd": "${workspaceFolder}/scheduler" - }, - { - "name": "cli uninstall", - "type": "go", - "request": "launch", - "mode": "debug", - "program": "${workspaceFolder}/cli", - "cwd": "${workspaceFolder}/cli", - "args": ["uninstall", "--yes"], - "buildFlags": "-tags=embed_manifests" - } - ] -} \ No newline at end of file + "version": "0.2.0", + "configurations": [ + { + "name": "Remote Odiglet", + "type": "go", + "request": "attach", + "mode": "remote", + "debugAdapter": "legacy", + "port": 2345, + "host": "127.0.0.1", + "remotePath": "" + }, + { + "name": "instrumentor local", + "type": "go", + "request": "launch", + "mode": "debug", + "program": "${workspaceFolder}/instrumentor", + "cwd": "${workspaceFolder}/instrumentor" + }, + { + "name": "frontend", + "type": "go", + "request": "launch", + "mode": "debug", + "program": "${workspaceFolder}/frontend", + "cwd": "${workspaceFolder}/frontend", + "args": ["--port", "8085", "--address", "0.0.0.0"] + }, + { + "name": "gql-playground", + "type": "go", + "request": "launch", + "mode": "debug", + "program": "${workspaceFolder}/frontend/main.go", + "cwd": "${workspaceFolder}/frontend" + }, + { + "name": "autoscaler local", + "type": "go", + "request": "launch", + "mode": "debug", + "program": "${workspaceFolder}/autoscaler", + "cwd": "${workspaceFolder}/autoscaler", + "env": { + "ODIGOS_VERSION": "v1.0.90" + } + }, + { + "name": "scheduler local", + "type": "go", + "request": "launch", + "mode": "debug", + "program": "${workspaceFolder}/scheduler", + "cwd": "${workspaceFolder}/scheduler" + }, + { + "name": "cli uninstall", + "type": "go", + "request": "launch", + "mode": "debug", + "program": "${workspaceFolder}/cli", + "cwd": "${workspaceFolder}/cli", + "args": ["uninstall", "--yes"], + "buildFlags": "-tags=embed_manifests" + } + ] +} diff --git a/frontend/Makefile b/frontend/Makefile new file mode 100644 index 000000000..a3dc15e31 --- /dev/null +++ b/frontend/Makefile @@ -0,0 +1,2 @@ +gqlgen: + go run github.com/99designs/gqlgen generate \ No newline at end of file diff --git a/frontend/endpoints/applications.go b/frontend/endpoints/applications.go index a29346cf0..0a71c5a39 100644 --- a/frontend/endpoints/applications.go +++ b/frontend/endpoints/applications.go @@ -31,12 +31,10 @@ const ( ) type GetApplicationItemInNamespace struct { - Name string `json:"name"` - Kind WorkloadKind `json:"kind"` - Instances int `json:"instances"` - AppInstrumentationLabeled *bool `json:"app_instrumentation_labeled"` - NsInstrumentationLabeled *bool `json:"ns_instrumentation_labeled"` - InstrumentationEffective bool `json:"instrumentation_effective"` + Name string `json:"name"` + Kind WorkloadKind `json:"kind"` + Instances int `json:"instances"` + WorkloadLabeled *bool `json:"workload_labels"` } type GetApplicationItem struct { @@ -113,19 +111,6 @@ func getApplicationsInNamespace(ctx context.Context, nsName string, nsInstrument copy(items[len(deps):], ss) copy(items[len(deps)+len(ss):], dss) - for i := range items { - item := &items[i] - // check if the entire namespace is instrumented - // as it affects the applications in the namespace - // which use this label to determine if they should be instrumented - nsInstrumentationLabeled := nsInstrumentedMap[item.namespace] - item.nsItem.NsInstrumentationLabeled = nsInstrumentationLabeled - appInstrumented := (item.nsItem.AppInstrumentationLabeled != nil && *item.nsItem.AppInstrumentationLabeled) - appInstrumentationInherited := item.nsItem.AppInstrumentationLabeled == nil - nsInstrumented := (nsInstrumentationLabeled != nil && *nsInstrumentationLabeled) - item.nsItem.InstrumentationEffective = appInstrumented || (appInstrumentationInherited && nsInstrumented) - } - return items, nil } @@ -137,10 +122,10 @@ func getDeployments(namespace string, ctx context.Context) ([]GetApplicationItem response = append(response, GetApplicationItem{ namespace: dep.Namespace, nsItem: GetApplicationItemInNamespace{ - Name: dep.Name, - Kind: WorkloadKindDeployment, - Instances: int(dep.Status.AvailableReplicas), - AppInstrumentationLabeled: appInstrumentationLabeled, + Name: dep.Name, + Kind: WorkloadKindDeployment, + Instances: int(dep.Status.AvailableReplicas), + WorkloadLabeled: appInstrumentationLabeled, }, }) } @@ -162,10 +147,10 @@ func getStatefulSets(namespace string, ctx context.Context) ([]GetApplicationIte response = append(response, GetApplicationItem{ namespace: ss.Namespace, nsItem: GetApplicationItemInNamespace{ - Name: ss.Name, - Kind: WorkloadKindStatefulSet, - Instances: int(ss.Status.ReadyReplicas), - AppInstrumentationLabeled: appInstrumentationLabeled, + Name: ss.Name, + Kind: WorkloadKindStatefulSet, + Instances: int(ss.Status.ReadyReplicas), + WorkloadLabeled: appInstrumentationLabeled, }, }) } @@ -187,10 +172,10 @@ func getDaemonSets(namespace string, ctx context.Context) ([]GetApplicationItem, response = append(response, GetApplicationItem{ namespace: ds.Namespace, nsItem: GetApplicationItemInNamespace{ - Name: ds.Name, - Kind: WorkloadKindDaemonSet, - Instances: int(ds.Status.NumberReady), - AppInstrumentationLabeled: appInstrumentationLabeled, + Name: ds.Name, + Kind: WorkloadKindDaemonSet, + Instances: int(ds.Status.NumberReady), + WorkloadLabeled: appInstrumentationLabeled, }, }) } diff --git a/frontend/endpoints/config.go b/frontend/endpoints/config.go index f58e77131..f98dcc73b 100644 --- a/frontend/endpoints/config.go +++ b/frontend/endpoints/config.go @@ -4,9 +4,7 @@ import ( "context" "fmt" "log" - "net/http" - "github.com/gin-gonic/gin" "github.com/odigos-io/odigos/common/consts" "github.com/odigos-io/odigos/frontend/kube" metav1 "k8s.io/apimachinery/pkg/apis/meta/v1" @@ -24,17 +22,17 @@ type GetConfigResponse struct { Installation InstallationStatus `json:"installation"` } -func GetConfig(c *gin.Context) { +func GetConfig(c context.Context) GetConfigResponse { var response GetConfigResponse - if !isSomethingLabeled(c.Request.Context()) { + if !isSomethingLabeled(c) { response.Installation = NewInstallation - } else if !isDestinationChosen(c.Request.Context()) { + } else if !isDestinationChosen(c) { response.Installation = AppsSelected } else { response.Installation = Finished } - c.JSON(http.StatusOK, response) + return response } func isDestinationChosen(ctx context.Context) bool { diff --git a/frontend/endpoints/destinations.go b/frontend/endpoints/destinations.go index 6eb900f2b..0be797fb8 100644 --- a/frontend/endpoints/destinations.go +++ b/frontend/endpoints/destinations.go @@ -4,9 +4,10 @@ import ( "context" "encoding/json" "fmt" + "net/http" + "github.com/odigos-io/odigos/frontend/endpoints/destination_recognition" "github.com/odigos-io/odigos/k8sutils/pkg/env" - "net/http" "github.com/gin-gonic/gin" "github.com/odigos-io/odigos/api/odigos/v1alpha1" diff --git a/frontend/endpoints/namespaces.go b/frontend/endpoints/namespaces.go index 9c88632b9..55184c9f7 100644 --- a/frontend/endpoints/namespaces.go +++ b/frontend/endpoints/namespaces.go @@ -74,6 +74,46 @@ func GetNamespaces(c *gin.Context, odigosns string) { c.JSON(http.StatusOK, response) } +func GetK8SNamespaces(ctx context.Context, odigosns string) GetNamespacesResponse { + + var ( + relevantNameSpaces []v1.Namespace + appsPerNamespace map[string]int + ) + + g, ctx := errgroup.WithContext(ctx) + g.Go(func() error { + var err error + relevantNameSpaces, err = getRelevantNameSpaces(ctx, odigosns) + return err + }) + + g.Go(func() error { + var err error + appsPerNamespace, err = CountAppsPerNamespace(ctx) + return err + }) + + if err := g.Wait(); err != nil { + + return GetNamespacesResponse{} + } + + var response GetNamespacesResponse + for _, namespace := range relevantNameSpaces { + // check if entire namespace is instrumented + selected := namespace.Labels[consts.OdigosInstrumentationLabel] == consts.InstrumentationEnabled + + response.Namespaces = append(response.Namespaces, GetNamespaceItem{ + Name: namespace.Name, + Selected: selected, + TotalApps: appsPerNamespace[namespace.Name], + }) + } + + return response +} + // getRelevantNameSpaces returns a list of namespaces that are relevant for instrumentation. // Taking into account the ignored namespaces from the OdigosConfiguration. func getRelevantNameSpaces(ctx context.Context, odigosns string) ([]v1.Namespace, error) { diff --git a/frontend/endpoints/sources.go b/frontend/endpoints/sources.go index 222e7afed..682e1ce45 100644 --- a/frontend/endpoints/sources.go +++ b/frontend/endpoints/sources.go @@ -85,13 +85,7 @@ func GetSources(c *gin.Context, odigosns string) { } for _, item := range items { - if item.nsItem.InstrumentationEffective { - id := common.SourceID{Namespace: item.namespace, Kind: workload.WorkloadKind(item.nsItem.Kind), Name: item.nsItem.Name} - effectiveInstrumentedSources[id] = ThinSource{ - NumberOfRunningInstances: item.nsItem.Instances, - SourceID: id, - } - } + println(item.nsItem.Name) } sourcesResult := []ThinSource{} diff --git a/frontend/go.mod b/frontend/go.mod index 5a5a36606..617ea6275 100644 --- a/frontend/go.mod +++ b/frontend/go.mod @@ -3,6 +3,7 @@ module github.com/odigos-io/odigos/frontend go 1.22.0 require ( + github.com/99designs/gqlgen v0.17.49 github.com/gin-contrib/cors v1.4.0 github.com/gin-gonic/gin v1.9.1 github.com/go-logr/logr v1.4.2 @@ -11,6 +12,7 @@ require ( github.com/odigos-io/odigos/destinations v0.0.0-20240223090638-df3328a088bc github.com/odigos-io/odigos/k8sutils v0.0.0 github.com/stretchr/testify v1.9.0 + github.com/vektah/gqlparser/v2 v2.5.16 go.opentelemetry.io/collector/component v0.106.1 go.opentelemetry.io/collector/confmap v0.106.1 go.opentelemetry.io/collector/exporter v0.106.0 @@ -78,6 +80,7 @@ require ( ) require ( + github.com/agnivade/levenshtein v1.1.1 // indirect github.com/bytedance/sonic v1.9.2 // indirect github.com/chenzhuoyu/base64x v0.0.0-20221115062448-fe3a3abad311 // indirect github.com/davecgh/go-spew v1.1.2-0.20180830191138-d8f796af33cc // indirect @@ -101,6 +104,8 @@ require ( github.com/google/go-cmp v0.6.0 // indirect github.com/google/gofuzz v1.2.0 // indirect github.com/google/uuid v1.6.0 // indirect + github.com/gorilla/websocket v1.5.0 // indirect + github.com/hashicorp/golang-lru/v2 v2.0.7 // indirect github.com/imdario/mergo v0.3.12 // indirect github.com/josharian/intern v1.0.0 // indirect github.com/json-iterator/go v1.1.12 // indirect @@ -109,11 +114,13 @@ require ( github.com/mailru/easyjson v0.7.7 // indirect github.com/mattn/go-colorable v0.1.13 // indirect github.com/mattn/go-isatty v0.0.20 // indirect + github.com/mitchellh/mapstructure v1.5.0 // indirect github.com/modern-go/concurrent v0.0.0-20180306012644-bacd9c7ef1dd // indirect github.com/modern-go/reflect2 v1.0.2 // indirect github.com/munnerz/goautoneg v0.0.0-20191010083416-a7dc8b61c822 // indirect github.com/pelletier/go-toml/v2 v2.0.8 // indirect github.com/pkg/errors v0.9.1 // indirect + github.com/sosodev/duration v1.3.1 // indirect github.com/spf13/pflag v1.0.5 // indirect github.com/twitchyliquid64/golang-asm v0.15.1 // indirect github.com/ugorji/go/codec v1.2.11 // indirect @@ -150,4 +157,5 @@ replace ( github.com/odigos-io/odigos/common => ../common github.com/odigos-io/odigos/destinations => ../destinations github.com/odigos-io/odigos/k8sutils => ../k8sutils + ) diff --git a/frontend/go.sum b/frontend/go.sum index c481a4420..a6ed52ff1 100644 --- a/frontend/go.sum +++ b/frontend/go.sum @@ -1,3 +1,15 @@ +github.com/99designs/gqlgen v0.17.49 h1:b3hNGexHd33fBSAd4NDT/c3NCcQzcAVkknhN9ym36YQ= +github.com/99designs/gqlgen v0.17.49/go.mod h1:tC8YFVZMed81x7UJ7ORUwXF4Kn6SXuucFqQBhN8+BU0= +github.com/PuerkitoBio/goquery v1.9.2 h1:4/wZksC3KgkQw7SQgkKotmKljk0M6V8TUvA8Wb4yPeE= +github.com/PuerkitoBio/goquery v1.9.2/go.mod h1:GHPCaP0ODyyxqcNoFGYlAprUFH81NuRPd0GX3Zu2Mvk= +github.com/agnivade/levenshtein v1.1.1 h1:QY8M92nrzkmr798gCo3kmMyqXFzdQVpxLlGPRBij0P8= +github.com/agnivade/levenshtein v1.1.1/go.mod h1:veldBMzWxcCG2ZvUTKD2kJNRdCk5hVbJomOvKkmgYbo= +github.com/andreyvit/diff v0.0.0-20170406064948-c7f18ee00883 h1:bvNMNQO63//z+xNgfBlViaCIJKLlCJ6/fmUseuG0wVQ= +github.com/andreyvit/diff v0.0.0-20170406064948-c7f18ee00883/go.mod h1:rCTlJbsFo29Kk6CurOXKm700vrz8f0KW0JNfpkRJY/8= +github.com/andybalholm/cascadia v1.3.2 h1:3Xi6Dw5lHF15JtdcmAHD3i1+T8plmv7BQ/nsViSLyss= +github.com/andybalholm/cascadia v1.3.2/go.mod h1:7gtRlve5FxPPgIgX36uWBX58OdBsSS6lUvCFb+h7KvU= +github.com/arbovm/levenshtein v0.0.0-20160628152529-48b4e1c0c4d0 h1:jfIu9sQUG6Ig+0+Ap1h4unLjW6YQJpKZVmUzxsD4E/Q= +github.com/arbovm/levenshtein v0.0.0-20160628152529-48b4e1c0c4d0/go.mod h1:t2tdKJDJF9BV14lnkjHmOQgcvEKgtqs5a1N3LNdJhGE= github.com/beorn7/perks v1.0.1 h1:VlbKKnNfV8bJzeqoa4cOKqO6bYr3WgKZxO8Z16+hsOM= github.com/beorn7/perks v1.0.1/go.mod h1:G2ZrVWU2WbWT9wwq4/hrbKbnv/1ERSJQ0ibhJ6rlkpw= github.com/bytedance/sonic v1.5.0/go.mod h1:ED5hyg4y6t3/9Ku1R6dU/4KyJ48DZ4jPhfY1O2AihPM= @@ -15,6 +27,8 @@ github.com/davecgh/go-spew v1.1.0/go.mod h1:J7Y8YcW2NihsgmVo/mv3lAwl/skON4iLHjSs github.com/davecgh/go-spew v1.1.1/go.mod h1:J7Y8YcW2NihsgmVo/mv3lAwl/skON4iLHjSsI+c5H38= github.com/davecgh/go-spew v1.1.2-0.20180830191138-d8f796af33cc h1:U9qPSI2PIWSS1VwoXQT9A3Wy9MM3WgvqSxFWenqJduM= github.com/davecgh/go-spew v1.1.2-0.20180830191138-d8f796af33cc/go.mod h1:J7Y8YcW2NihsgmVo/mv3lAwl/skON4iLHjSsI+c5H38= +github.com/dgryski/trifles v0.0.0-20200323201526-dd97f9abfb48 h1:fRzb/w+pyskVMQ+UbP35JkH8yB7MYb4q/qhBarqZE6g= +github.com/dgryski/trifles v0.0.0-20200323201526-dd97f9abfb48/go.mod h1:if7Fbed8SFyPtHLHbg49SI7NAdJiC5WIA09pe59rfAA= github.com/emicklei/go-restful/v3 v3.11.0 h1:rAQeMHw1c7zTmncogyy8VvRZwtkmkZ4FxERmMY4rD+g= github.com/emicklei/go-restful/v3 v3.11.0/go.mod h1:6n3XBCmQQb25CM2LCACGz8ukIrRry+4bhvbpWn3mrbc= github.com/evanphx/json-patch/v5 v5.9.0 h1:kcBlZQbplgElYIlo/n1hJbls2z/1awpXxpRi0/FOJfg= @@ -91,10 +105,14 @@ github.com/google/pprof v0.0.0-20240525223248-4bfdf5a9a2af h1:kmjWCqn2qkEml422C2 github.com/google/pprof v0.0.0-20240525223248-4bfdf5a9a2af/go.mod h1:K1liHPHnj73Fdn/EKuT8nrFqBihUSKXoLYU0BuatOYo= github.com/google/uuid v1.6.0 h1:NIvaJDMOsjHA8n1jAhLSgzrAzy1Hgr+hNrb57e+94F0= github.com/google/uuid v1.6.0/go.mod h1:TIyPZe4MgqvfeYDBFedMoGGpEw/LqOeaOT+nhxU+yHo= +github.com/gorilla/websocket v1.5.0 h1:PPwGk2jz7EePpoHN/+ClbZu8SPxiqlu12wZP/3sWmnc= +github.com/gorilla/websocket v1.5.0/go.mod h1:YR8l580nyteQvAITg2hZ9XVh4b55+EU/adAjf1fMHhE= github.com/grpc-ecosystem/grpc-gateway/v2 v2.20.0 h1:bkypFPDjIYGfCYD5mRBvpqxfYX1YCS1PXdKYWi8FsN0= github.com/grpc-ecosystem/grpc-gateway/v2 v2.20.0/go.mod h1:P+Lt/0by1T8bfcF3z737NnSbmxQAppXMRziHUxPOC8k= github.com/hashicorp/go-version v1.7.0 h1:5tqGy27NaOTB8yJKUZELlFAS/LTKJkrmONwQKeRZfjY= github.com/hashicorp/go-version v1.7.0/go.mod h1:fltr4n8CU8Ke44wwGCBoEymUuxUHl09ZGVZPK5anwXA= +github.com/hashicorp/golang-lru/v2 v2.0.7 h1:a+bsQ5rvGLjzHuww6tVxozPZFVghXaHOwFs4luLUK2k= +github.com/hashicorp/golang-lru/v2 v2.0.7/go.mod h1:QeFd9opnmA6QUJc5vARoKUSoFhyfM2/ZepoAG6RGpeM= github.com/imdario/mergo v0.3.12 h1:b6R2BslTbIEToALKP7LxUvijTsNI9TAe80pLWN2g/HU= github.com/imdario/mergo v0.3.12/go.mod h1:jmQim1M+e3UYxmgPu/WyfjB3N3VflVyUjjjwH0dnCYA= github.com/josharian/intern v1.0.0 h1:vlS4z54oSdjm0bgjRigI+G1HpF+tI+9rE5LLzOg8HmY= @@ -136,6 +154,8 @@ github.com/mattn/go-isatty v0.0.20 h1:xfD0iDuEKnDkl03q4limB+vH+GxLEtL/jb4xVJSWWE github.com/mattn/go-isatty v0.0.20/go.mod h1:W+V8PltTTMOvKvAeJH7IuucS94S2C6jfK/D7dTCTo3Y= github.com/mitchellh/copystructure v1.2.0 h1:vpKXTN4ewci03Vljg/q9QvCGUDttBOGBIa15WveJJGw= github.com/mitchellh/copystructure v1.2.0/go.mod h1:qLl+cE2AmVv+CoeAwDPye/v+N2HKCj9FbZEVFJRxO9s= +github.com/mitchellh/mapstructure v1.5.0 h1:jeMsZIYE/09sWLaz43PL7Gy6RuMjD2eJVyuac5Z2hdY= +github.com/mitchellh/mapstructure v1.5.0/go.mod h1:bFUtVrKA4DC2yAKiSyO/QUcy7e+RRV2QTWOzhPopBRo= github.com/mitchellh/reflectwalk v1.0.2 h1:G2LzWKi524PWgd3mLHV8Y5k7s6XUvT0Gef6zxSIeXaQ= github.com/mitchellh/reflectwalk v1.0.2/go.mod h1:mSTlrgnPZtwu0c4WaC2kGObEpuNDbx0jmZXqmk4esnw= github.com/modern-go/concurrent v0.0.0-20180228061459-e0a39a4cb421/go.mod h1:6dJC0mAP4ikYIbvyc7fijjWJddQyLn8Ig3JB5CqoB9Q= @@ -174,6 +194,10 @@ github.com/rogpeppe/go-internal v1.12.0 h1:exVL4IDcn6na9z1rAb56Vxr+CgyK3nn3O+epU github.com/rogpeppe/go-internal v1.12.0/go.mod h1:E+RYuTGaKKdloAfM02xzb0FW3Paa99yedzYV+kq4uf4= github.com/rs/cors v1.11.0 h1:0B9GE/r9Bc2UxRMMtymBkHTenPkHDv0CW4Y98GBY+po= github.com/rs/cors v1.11.0/go.mod h1:XyqrcTp5zjWr1wsJ8PIRZssZ8b/WMcMf71DJnit4EMU= +github.com/sergi/go-diff v1.3.1 h1:xkr+Oxo4BOQKmkn/B9eMK0g5Kg/983T9DqqPHwYqD+8= +github.com/sergi/go-diff v1.3.1/go.mod h1:aMJSSKb2lpPvRNec0+w3fl7LP9IOFzdc9Pa4NFbPK1I= +github.com/sosodev/duration v1.3.1 h1:qtHBDMQ6lvMQsL15g4aopM4HEfOaYuhWBw3NPTtlqq4= +github.com/sosodev/duration v1.3.1/go.mod h1:RQIBBX0+fMLc/D9+Jb/fwvVmo0eZvDDEERAikUR6SDg= github.com/spf13/pflag v1.0.5 h1:iy+VFUOCP1a+8yFto/drg2CJ5u0yRoB7fZw3DKv/JXA= github.com/spf13/pflag v1.0.5/go.mod h1:McXfInJRrz4CZXVZOBLb0bTZqETkiAhM9Iw0y3An2Bg= github.com/stretchr/objx v0.1.0/go.mod h1:HFkY916IF+rwdDfMAkV7OtwuqBVzrE8GR6GFx+wExME= @@ -197,6 +221,8 @@ github.com/ugorji/go v1.2.7/go.mod h1:nF9osbDWLy6bDVv/Rtoh6QgnvNDpmCalQV5urGCCS6 github.com/ugorji/go/codec v1.2.7/go.mod h1:WGN1fab3R1fzQlVQTkfxVtIBhWDRqOviHU95kRgeqEY= github.com/ugorji/go/codec v1.2.11 h1:BMaWp1Bb6fHwEtbplGBGJ498wD+LKlNSl25MjdZY4dU= github.com/ugorji/go/codec v1.2.11/go.mod h1:UNopzCgEMSXjBc6AOMqYvWC1ktqTAfzJZUZgYf6w6lg= +github.com/vektah/gqlparser/v2 v2.5.16 h1:1gcmLTvs3JLKXckwCwlUagVn/IlV2bwqle0vJ0vy5p8= +github.com/vektah/gqlparser/v2 v2.5.16/go.mod h1:1lz1OeCqgQbQepsGxPVywrjdBHW2T08PUS3pJqepRww= github.com/x448/float16 v0.8.4 h1:qLwI1I70+NjRFUR3zs1JPUCgaCXSh3SW62uAKT1mSBM= github.com/x448/float16 v0.8.4/go.mod h1:14CWIYCyZA/cWjXOioeEpHeN/83MdbZDRQHoFcYsOfg= github.com/yuin/goldmark v1.1.27/go.mod h1:3hX8gzYuyVAZsxl0MRgGTJEmQBFcNTphYh9decYSb74= @@ -358,8 +384,8 @@ golang.org/x/tools v0.0.0-20180917221912-90fa682c2a6e/go.mod h1:n7NCudcB/nEzxVGm golang.org/x/tools v0.0.0-20191119224855-298f0cb1881e/go.mod h1:b+2E5dAYhXwXZwtnZ6UAqBI28+e2cm9otk0dWdXHAEo= golang.org/x/tools v0.0.0-20200619180055-7c47624df98f/go.mod h1:EkVYQZoAsY45+roYkvgYkIh4xh/qjgUK9TdY2XT94GE= golang.org/x/tools v0.0.0-20210106214847-113979e3529a/go.mod h1:emZCQorbCU4vsT4fOWvOPXz4eW1wZW4PmDk9uLelYpA= -golang.org/x/tools v0.21.1-0.20240508182429-e35e4ccd0d2d h1:vU5i/LfpvrRCpgM/VPfJLg5KjxD3E+hfT1SH+d9zLwg= -golang.org/x/tools v0.21.1-0.20240508182429-e35e4ccd0d2d/go.mod h1:aiJjzUbINMkxbQROHiO6hDPo2LHcIPhhQsa9DLh0yGk= +golang.org/x/tools v0.22.0 h1:gqSGLZqv+AI9lIQzniJ0nZDRG5GBPsSi+DRNHWNz6yA= +golang.org/x/tools v0.22.0/go.mod h1:aCwcsjqvq7Yqt6TNyX7QMU2enbQ/Gt0bo6krSeEri+c= golang.org/x/xerrors v0.0.0-20190717185122-a985d3407aa7/go.mod h1:I/5z698sn9Ka8TeJc9MKroUUfqBBauWjQqLJ2OPfmY0= golang.org/x/xerrors v0.0.0-20191011141410-1b5146add898/go.mod h1:I/5z698sn9Ka8TeJc9MKroUUfqBBauWjQqLJ2OPfmY0= golang.org/x/xerrors v0.0.0-20191204190536-9bdfabe68543/go.mod h1:I/5z698sn9Ka8TeJc9MKroUUfqBBauWjQqLJ2OPfmY0= diff --git a/frontend/gqlgen.yml b/frontend/gqlgen.yml new file mode 100644 index 000000000..7212cc7cb --- /dev/null +++ b/frontend/gqlgen.yml @@ -0,0 +1,62 @@ +# Where are all the schema files located? globs are supported eg src/**/*.graphqls +schema: + - graph/*.graphqls + +# Where should the generated server code go? +exec: + filename: graph/generated.go + package: graph + +# Uncomment to enable federation +# federation: +# filename: graph/federation.go +# package: graph + +# Where should any generated models go? +model: + filename: graph/model/models_gen.go + package: model + +# Where should the resolver implementations go? +resolver: + layout: follow-schema + dir: graph + package: graph + filename_template: '{name}.resolvers.go' + +# gqlgen will search for any type names in the schema in these go packages +# if they match it will use them, otherwise it will generate them. +autobind: + - 'github.com/odigos-io/odigos/frontend/graph/model' + +models: + ID: + model: + - github.com/99designs/gqlgen/graphql.ID + - github.com/99designs/gqlgen/graphql.Int + - github.com/99designs/gqlgen/graphql.Int64 + - github.com/99designs/gqlgen/graphql.Int32 + Int: + model: + - github.com/99designs/gqlgen/graphql.Int + - github.com/99designs/gqlgen/graphql.Int64 + - github.com/99designs/gqlgen/graphql.Int32 + + ComputePlatform: + fields: + k8sActualNamespace: + resolver: true + k8sActualNamespaces: + resolver: true + k8sActualSource: + resolver: true + destinations: + resolver: true + actions: + resolver: true + k8sActualSources: + resolver: true + K8sActualNamespace: + fields: + k8sActualSources: + resolver: true diff --git a/frontend/graph/conversions.go b/frontend/graph/conversions.go new file mode 100644 index 000000000..71b7df4fa --- /dev/null +++ b/frontend/graph/conversions.go @@ -0,0 +1,150 @@ +package graph + +import ( + "time" + + "github.com/odigos-io/odigos/api/odigos/v1alpha1" + gqlmodel "github.com/odigos-io/odigos/frontend/graph/model" + "github.com/odigos-io/odigos/frontend/services" + v1 "k8s.io/apimachinery/pkg/apis/meta/v1" +) + +func k8sKindToGql(k8sResourceKind string) gqlmodel.K8sResourceKind { + switch k8sResourceKind { + case "Deployment": + return gqlmodel.K8sResourceKindDeployment + case "StatefulSet": + return gqlmodel.K8sResourceKindStatefulSet + case "DaemonSet": + return gqlmodel.K8sResourceKindDaemonSet + } + return "" +} + +func k8sConditionStatusToGql(status v1.ConditionStatus) gqlmodel.ConditionStatus { + switch status { + case v1.ConditionTrue: + return gqlmodel.ConditionStatusTrue + case v1.ConditionFalse: + return gqlmodel.ConditionStatusFalse + case v1.ConditionUnknown: + return gqlmodel.ConditionStatusUnknown + } + return gqlmodel.ConditionStatusUnknown + +} + +func k8sLastTransitionTimeToGql(t v1.Time) *string { + if t.IsZero() { + return nil + } + str := t.UTC().Format(time.RFC3339) + return &str +} + +func k8sThinSourceToGql(k8sSource *services.ThinSource) *gqlmodel.K8sActualSource { + + hasInstrumentedApplication := k8sSource.IaDetails != nil + + var gqlIaDetails *gqlmodel.InstrumentedApplicationDetails + if hasInstrumentedApplication { + gqlIaDetails = &gqlmodel.InstrumentedApplicationDetails{ + Containers: make([]*gqlmodel.SourceContainerRuntimeDetails, len(k8sSource.IaDetails.Languages)), + Conditions: make([]*gqlmodel.Condition, len(k8sSource.IaDetails.Conditions)), + } + + for i, lang := range k8sSource.IaDetails.Languages { + gqlIaDetails.Containers[i] = &gqlmodel.SourceContainerRuntimeDetails{ + ContainerName: lang.ContainerName, + Language: lang.Language, + } + } + + for i, cond := range k8sSource.IaDetails.Conditions { + gqlIaDetails.Conditions[i] = &gqlmodel.Condition{ + Type: cond.Type, + Status: k8sConditionStatusToGql(cond.Status), + Reason: &cond.Reason, + LastTransitionTime: k8sLastTransitionTimeToGql(cond.LastTransitionTime), + Message: &cond.Message, + } + } + } + + return &gqlmodel.K8sActualSource{ + Namespace: k8sSource.Namespace, + Kind: k8sKindToGql(k8sSource.Kind), + Name: k8sSource.Name, + NumberOfInstances: &k8sSource.NumberOfRunningInstances, + InstrumentedApplicationDetails: gqlIaDetails, + } +} + +func k8sSourceToGql(k8sSource *services.Source) *gqlmodel.K8sActualSource { + baseSource := k8sThinSourceToGql(&k8sSource.ThinSource) + return &gqlmodel.K8sActualSource{ + Namespace: baseSource.Namespace, + Kind: baseSource.Kind, + Name: baseSource.Name, + NumberOfInstances: baseSource.NumberOfInstances, + InstrumentedApplicationDetails: baseSource.InstrumentedApplicationDetails, + ServiceName: &k8sSource.ReportedName, + } +} + +func instrumentedApplicationToActualSource(instrumentedApp v1alpha1.InstrumentedApplication) *gqlmodel.K8sActualSource { + // Map the container runtime details + var containers []*gqlmodel.SourceContainerRuntimeDetails + for _, container := range instrumentedApp.Spec.RuntimeDetails { + containers = append(containers, &gqlmodel.SourceContainerRuntimeDetails{ + ContainerName: container.ContainerName, + Language: string(container.Language), + }) + } + + // Map the conditions of the application + var conditions []*gqlmodel.Condition + for _, condition := range instrumentedApp.Status.Conditions { + conditions = append(conditions, &gqlmodel.Condition{ + Type: condition.Type, + Status: k8sConditionStatusToGql(condition.Status), + Reason: &condition.Reason, + LastTransitionTime: k8sLastTransitionTimeToGql(condition.LastTransitionTime), + Message: &condition.Message, + }) + } + + // Map the options for instrumentation libraries + var instrumentationOptions []*gqlmodel.InstrumentedApplicationDetails + for _, option := range instrumentedApp.Spec.Options { + for _, libOptions := range option.InstrumentationLibraries { + var libraries []*gqlmodel.InstrumentationOption + for _, configOption := range libOptions.Options { + libraries = append(libraries, &gqlmodel.InstrumentationOption{ + OptionKey: configOption.OptionKey, + SpanKind: gqlmodel.SpanKind(configOption.SpanKind), + }) + } + + instrumentationOptions = append(instrumentationOptions, &gqlmodel.InstrumentedApplicationDetails{ + Containers: containers, + Conditions: conditions, + }) + } + } + + // Return the converted K8sActualSource object + return &gqlmodel.K8sActualSource{ + Namespace: instrumentedApp.Namespace, + Kind: k8sKindToGql(instrumentedApp.OwnerReferences[0].Kind), + Name: instrumentedApp.OwnerReferences[0].Name, + ServiceName: &instrumentedApp.Name, + NumberOfInstances: nil, + AutoInstrumented: instrumentedApp.Spec.Options != nil, + AutoInstrumentedDecision: "", + InstrumentedApplicationDetails: &gqlmodel.InstrumentedApplicationDetails{ + Containers: containers, + Conditions: conditions, + }, + } +} diff --git a/frontend/graph/generated.go b/frontend/graph/generated.go new file mode 100644 index 000000000..024d98918 --- /dev/null +++ b/frontend/graph/generated.go @@ -0,0 +1,10937 @@ +// Code generated by github.com/99designs/gqlgen, DO NOT EDIT. + +package graph + +import ( + "bytes" + "context" + "embed" + "errors" + "fmt" + "strconv" + "sync" + "sync/atomic" + + "github.com/99designs/gqlgen/graphql" + "github.com/99designs/gqlgen/graphql/introspection" + "github.com/odigos-io/odigos/frontend/graph/model" + gqlparser "github.com/vektah/gqlparser/v2" + "github.com/vektah/gqlparser/v2/ast" +) + +// region ************************** generated!.gotpl ************************** + +// NewExecutableSchema creates an ExecutableSchema from the ResolverRoot interface. +func NewExecutableSchema(cfg Config) graphql.ExecutableSchema { + return &executableSchema{ + schema: cfg.Schema, + resolvers: cfg.Resolvers, + directives: cfg.Directives, + complexity: cfg.Complexity, + } +} + +type Config struct { + Schema *ast.Schema + Resolvers ResolverRoot + Directives DirectiveRoot + Complexity ComplexityRoot +} + +type ResolverRoot interface { + ComputePlatform() ComputePlatformResolver + Destination() DestinationResolver + K8sActualNamespace() K8sActualNamespaceResolver + Mutation() MutationResolver + Query() QueryResolver +} + +type DirectiveRoot struct { +} + +type ComplexityRoot struct { + ComputePlatform struct { + Actions func(childComplexity int) int + ComputePlatformType func(childComplexity int) int + Destinations func(childComplexity int) int + K8sActualNamespace func(childComplexity int, name string) int + K8sActualNamespaces func(childComplexity int) int + K8sActualSource func(childComplexity int, name *string, namespace *string, kind *string) int + K8sActualSources func(childComplexity int) int + } + + Condition struct { + LastTransitionTime func(childComplexity int) int + Message func(childComplexity int) int + Reason func(childComplexity int) int + Status func(childComplexity int) int + Type func(childComplexity int) int + } + + Destination struct { + Conditions func(childComplexity int) int + DestinationType func(childComplexity int) int + ExportedSignals func(childComplexity int) int + Fields func(childComplexity int) int + Id func(childComplexity int) int + Name func(childComplexity int) int + Type func(childComplexity int) int + } + + DestinationDetails struct { + Fields func(childComplexity int) int + Type func(childComplexity int) int + URLString func(childComplexity int) int + } + + DestinationTypesCategoryItem struct { + DisplayName func(childComplexity int) int + ImageUrl func(childComplexity int) int + SupportedSignals func(childComplexity int) int + TestConnectionSupported func(childComplexity int) int + Type func(childComplexity int) int + } + + DestinationsCategory struct { + Items func(childComplexity int) int + Name func(childComplexity int) int + } + + ExportedSignals struct { + Logs func(childComplexity int) int + Metrics func(childComplexity int) int + Traces func(childComplexity int) int + } + + Field struct { + ComponentProperties func(childComplexity int) int + ComponentType func(childComplexity int) int + DisplayName func(childComplexity int) int + InitialValue func(childComplexity int) int + Name func(childComplexity int) int + ThumbnailURL func(childComplexity int) int + VideoURL func(childComplexity int) int + } + + GetConfigResponse struct { + Installation func(childComplexity int) int + } + + GetDestinationDetailsResponse struct { + Fields func(childComplexity int) int + } + + GetDestinationTypesResponse struct { + Categories func(childComplexity int) int + } + + IcaInstanceResponse struct { + ID func(childComplexity int) int + Spec func(childComplexity int) int + Type func(childComplexity int) int + } + + InstrumentationLibrary struct { + LibraryName func(childComplexity int) int + Options func(childComplexity int) int + } + + InstrumentationOption struct { + OptionKey func(childComplexity int) int + SpanKind func(childComplexity int) int + } + + InstrumentedApplicationDetails struct { + Conditions func(childComplexity int) int + Containers func(childComplexity int) int + InstrumentationOptions func(childComplexity int) int + } + + K8sActualNamespace struct { + InstrumentationLabelEnabled func(childComplexity int) int + K8sActualSources func(childComplexity int, instrumentationLabeled *bool) int + Name func(childComplexity int) int + } + + K8sActualSource struct { + AutoInstrumented func(childComplexity int) int + AutoInstrumentedDecision func(childComplexity int) int + InstrumentedApplicationDetails func(childComplexity int) int + Kind func(childComplexity int) int + Name func(childComplexity int) int + Namespace func(childComplexity int) int + NumberOfInstances func(childComplexity int) int + ReportedName func(childComplexity int) int + ServiceName func(childComplexity int) int + } + + Mutation struct { + CreateNewDestination func(childComplexity int, destination model.DestinationInput) int + PersistK8sNamespace func(childComplexity int, namespace model.PersistNamespaceItemInput) int + PersistK8sSources func(childComplexity int, namespace string, sources []*model.PersistNamespaceSourceInput) int + TestConnectionForDestination func(childComplexity int, destination model.DestinationInput) int + UpdateDestination func(childComplexity int, id string, destination model.DestinationInput) int + UpdateK8sActualSource func(childComplexity int, sourceID model.K8sSourceID, patchSourceRequest model.PatchSourceRequestInput) int + } + + ObservabilitySignalSupport struct { + Supported func(childComplexity int) int + } + + Query struct { + ComputePlatform func(childComplexity int) int + Config func(childComplexity int) int + DestinationTypeDetails func(childComplexity int, typeArg string) int + DestinationTypes func(childComplexity int) int + PotentialDestinations func(childComplexity int) int + } + + SourceContainerRuntimeDetails struct { + ContainerName func(childComplexity int) int + Language func(childComplexity int) int + } + + SupportedSignals struct { + Logs func(childComplexity int) int + Metrics func(childComplexity int) int + Traces func(childComplexity int) int + } + + TestConnectionResponse struct { + DestinationType func(childComplexity int) int + Message func(childComplexity int) int + Reason func(childComplexity int) int + StatusCode func(childComplexity int) int + Succeeded func(childComplexity int) int + } +} + +type ComputePlatformResolver interface { + K8sActualNamespace(ctx context.Context, obj *model.ComputePlatform, name string) (*model.K8sActualNamespace, error) + K8sActualNamespaces(ctx context.Context, obj *model.ComputePlatform) ([]*model.K8sActualNamespace, error) + K8sActualSource(ctx context.Context, obj *model.ComputePlatform, name *string, namespace *string, kind *string) (*model.K8sActualSource, error) + K8sActualSources(ctx context.Context, obj *model.ComputePlatform) ([]*model.K8sActualSource, error) + Destinations(ctx context.Context, obj *model.ComputePlatform) ([]*model.Destination, error) + Actions(ctx context.Context, obj *model.ComputePlatform) ([]*model.IcaInstanceResponse, error) +} +type DestinationResolver interface { + Type(ctx context.Context, obj *model.Destination) (string, error) + + Conditions(ctx context.Context, obj *model.Destination) ([]*model.Condition, error) +} +type K8sActualNamespaceResolver interface { + K8sActualSources(ctx context.Context, obj *model.K8sActualNamespace, instrumentationLabeled *bool) ([]*model.K8sActualSource, error) +} +type MutationResolver interface { + CreateNewDestination(ctx context.Context, destination model.DestinationInput) (*model.Destination, error) + PersistK8sNamespace(ctx context.Context, namespace model.PersistNamespaceItemInput) (bool, error) + PersistK8sSources(ctx context.Context, namespace string, sources []*model.PersistNamespaceSourceInput) (bool, error) + TestConnectionForDestination(ctx context.Context, destination model.DestinationInput) (*model.TestConnectionResponse, error) + UpdateK8sActualSource(ctx context.Context, sourceID model.K8sSourceID, patchSourceRequest model.PatchSourceRequestInput) (bool, error) + UpdateDestination(ctx context.Context, id string, destination model.DestinationInput) (*model.Destination, error) +} +type QueryResolver interface { + ComputePlatform(ctx context.Context) (*model.ComputePlatform, error) + Config(ctx context.Context) (*model.GetConfigResponse, error) + DestinationTypes(ctx context.Context) (*model.GetDestinationTypesResponse, error) + DestinationTypeDetails(ctx context.Context, typeArg string) (*model.GetDestinationDetailsResponse, error) + PotentialDestinations(ctx context.Context) ([]*model.DestinationDetails, error) +} + +type executableSchema struct { + schema *ast.Schema + resolvers ResolverRoot + directives DirectiveRoot + complexity ComplexityRoot +} + +func (e *executableSchema) Schema() *ast.Schema { + if e.schema != nil { + return e.schema + } + return parsedSchema +} + +func (e *executableSchema) Complexity(typeName, field string, childComplexity int, rawArgs map[string]interface{}) (int, bool) { + ec := executionContext{nil, e, 0, 0, nil} + _ = ec + switch typeName + "." + field { + + case "ComputePlatform.actions": + if e.complexity.ComputePlatform.Actions == nil { + break + } + + return e.complexity.ComputePlatform.Actions(childComplexity), true + + case "ComputePlatform.computePlatformType": + if e.complexity.ComputePlatform.ComputePlatformType == nil { + break + } + + return e.complexity.ComputePlatform.ComputePlatformType(childComplexity), true + + case "ComputePlatform.destinations": + if e.complexity.ComputePlatform.Destinations == nil { + break + } + + return e.complexity.ComputePlatform.Destinations(childComplexity), true + + case "ComputePlatform.k8sActualNamespace": + if e.complexity.ComputePlatform.K8sActualNamespace == nil { + break + } + + args, err := ec.field_ComputePlatform_k8sActualNamespace_args(context.TODO(), rawArgs) + if err != nil { + return 0, false + } + + return e.complexity.ComputePlatform.K8sActualNamespace(childComplexity, args["name"].(string)), true + + case "ComputePlatform.k8sActualNamespaces": + if e.complexity.ComputePlatform.K8sActualNamespaces == nil { + break + } + + return e.complexity.ComputePlatform.K8sActualNamespaces(childComplexity), true + + case "ComputePlatform.k8sActualSource": + if e.complexity.ComputePlatform.K8sActualSource == nil { + break + } + + args, err := ec.field_ComputePlatform_k8sActualSource_args(context.TODO(), rawArgs) + if err != nil { + return 0, false + } + + return e.complexity.ComputePlatform.K8sActualSource(childComplexity, args["name"].(*string), args["namespace"].(*string), args["kind"].(*string)), true + + case "ComputePlatform.k8sActualSources": + if e.complexity.ComputePlatform.K8sActualSources == nil { + break + } + + return e.complexity.ComputePlatform.K8sActualSources(childComplexity), true + + case "Condition.lastTransitionTime": + if e.complexity.Condition.LastTransitionTime == nil { + break + } + + return e.complexity.Condition.LastTransitionTime(childComplexity), true + + case "Condition.message": + if e.complexity.Condition.Message == nil { + break + } + + return e.complexity.Condition.Message(childComplexity), true + + case "Condition.reason": + if e.complexity.Condition.Reason == nil { + break + } + + return e.complexity.Condition.Reason(childComplexity), true + + case "Condition.status": + if e.complexity.Condition.Status == nil { + break + } + + return e.complexity.Condition.Status(childComplexity), true + + case "Condition.type": + if e.complexity.Condition.Type == nil { + break + } + + return e.complexity.Condition.Type(childComplexity), true + + case "Destination.conditions": + if e.complexity.Destination.Conditions == nil { + break + } + + return e.complexity.Destination.Conditions(childComplexity), true + + case "Destination.destinationType": + if e.complexity.Destination.DestinationType == nil { + break + } + + return e.complexity.Destination.DestinationType(childComplexity), true + + case "Destination.exportedSignals": + if e.complexity.Destination.ExportedSignals == nil { + break + } + + return e.complexity.Destination.ExportedSignals(childComplexity), true + + case "Destination.fields": + if e.complexity.Destination.Fields == nil { + break + } + + return e.complexity.Destination.Fields(childComplexity), true + + case "Destination.id": + if e.complexity.Destination.Id == nil { + break + } + + return e.complexity.Destination.Id(childComplexity), true + + case "Destination.name": + if e.complexity.Destination.Name == nil { + break + } + + return e.complexity.Destination.Name(childComplexity), true + + case "Destination.type": + if e.complexity.Destination.Type == nil { + break + } + + return e.complexity.Destination.Type(childComplexity), true + + case "DestinationDetails.fields": + if e.complexity.DestinationDetails.Fields == nil { + break + } + + return e.complexity.DestinationDetails.Fields(childComplexity), true + + case "DestinationDetails.type": + if e.complexity.DestinationDetails.Type == nil { + break + } + + return e.complexity.DestinationDetails.Type(childComplexity), true + + case "DestinationDetails.urlString": + if e.complexity.DestinationDetails.URLString == nil { + break + } + + return e.complexity.DestinationDetails.URLString(childComplexity), true + + case "DestinationTypesCategoryItem.displayName": + if e.complexity.DestinationTypesCategoryItem.DisplayName == nil { + break + } + + return e.complexity.DestinationTypesCategoryItem.DisplayName(childComplexity), true + + case "DestinationTypesCategoryItem.imageUrl": + if e.complexity.DestinationTypesCategoryItem.ImageUrl == nil { + break + } + + return e.complexity.DestinationTypesCategoryItem.ImageUrl(childComplexity), true + + case "DestinationTypesCategoryItem.supportedSignals": + if e.complexity.DestinationTypesCategoryItem.SupportedSignals == nil { + break + } + + return e.complexity.DestinationTypesCategoryItem.SupportedSignals(childComplexity), true + + case "DestinationTypesCategoryItem.testConnectionSupported": + if e.complexity.DestinationTypesCategoryItem.TestConnectionSupported == nil { + break + } + + return e.complexity.DestinationTypesCategoryItem.TestConnectionSupported(childComplexity), true + + case "DestinationTypesCategoryItem.type": + if e.complexity.DestinationTypesCategoryItem.Type == nil { + break + } + + return e.complexity.DestinationTypesCategoryItem.Type(childComplexity), true + + case "DestinationsCategory.items": + if e.complexity.DestinationsCategory.Items == nil { + break + } + + return e.complexity.DestinationsCategory.Items(childComplexity), true + + case "DestinationsCategory.name": + if e.complexity.DestinationsCategory.Name == nil { + break + } + + return e.complexity.DestinationsCategory.Name(childComplexity), true + + case "ExportedSignals.logs": + if e.complexity.ExportedSignals.Logs == nil { + break + } + + return e.complexity.ExportedSignals.Logs(childComplexity), true + + case "ExportedSignals.metrics": + if e.complexity.ExportedSignals.Metrics == nil { + break + } + + return e.complexity.ExportedSignals.Metrics(childComplexity), true + + case "ExportedSignals.traces": + if e.complexity.ExportedSignals.Traces == nil { + break + } + + return e.complexity.ExportedSignals.Traces(childComplexity), true + + case "Field.componentProperties": + if e.complexity.Field.ComponentProperties == nil { + break + } + + return e.complexity.Field.ComponentProperties(childComplexity), true + + case "Field.componentType": + if e.complexity.Field.ComponentType == nil { + break + } + + return e.complexity.Field.ComponentType(childComplexity), true + + case "Field.displayName": + if e.complexity.Field.DisplayName == nil { + break + } + + return e.complexity.Field.DisplayName(childComplexity), true + + case "Field.initialValue": + if e.complexity.Field.InitialValue == nil { + break + } + + return e.complexity.Field.InitialValue(childComplexity), true + + case "Field.name": + if e.complexity.Field.Name == nil { + break + } + + return e.complexity.Field.Name(childComplexity), true + + case "Field.thumbnailURL": + if e.complexity.Field.ThumbnailURL == nil { + break + } + + return e.complexity.Field.ThumbnailURL(childComplexity), true + + case "Field.videoUrl": + if e.complexity.Field.VideoURL == nil { + break + } + + return e.complexity.Field.VideoURL(childComplexity), true + + case "GetConfigResponse.installation": + if e.complexity.GetConfigResponse.Installation == nil { + break + } + + return e.complexity.GetConfigResponse.Installation(childComplexity), true + + case "GetDestinationDetailsResponse.fields": + if e.complexity.GetDestinationDetailsResponse.Fields == nil { + break + } + + return e.complexity.GetDestinationDetailsResponse.Fields(childComplexity), true + + case "GetDestinationTypesResponse.categories": + if e.complexity.GetDestinationTypesResponse.Categories == nil { + break + } + + return e.complexity.GetDestinationTypesResponse.Categories(childComplexity), true + + case "IcaInstanceResponse.id": + if e.complexity.IcaInstanceResponse.ID == nil { + break + } + + return e.complexity.IcaInstanceResponse.ID(childComplexity), true + + case "IcaInstanceResponse.spec": + if e.complexity.IcaInstanceResponse.Spec == nil { + break + } + + return e.complexity.IcaInstanceResponse.Spec(childComplexity), true + + case "IcaInstanceResponse.type": + if e.complexity.IcaInstanceResponse.Type == nil { + break + } + + return e.complexity.IcaInstanceResponse.Type(childComplexity), true + + case "InstrumentationLibrary.libraryName": + if e.complexity.InstrumentationLibrary.LibraryName == nil { + break + } + + return e.complexity.InstrumentationLibrary.LibraryName(childComplexity), true + + case "InstrumentationLibrary.options": + if e.complexity.InstrumentationLibrary.Options == nil { + break + } + + return e.complexity.InstrumentationLibrary.Options(childComplexity), true + + case "InstrumentationOption.optionKey": + if e.complexity.InstrumentationOption.OptionKey == nil { + break + } + + return e.complexity.InstrumentationOption.OptionKey(childComplexity), true + + case "InstrumentationOption.spanKind": + if e.complexity.InstrumentationOption.SpanKind == nil { + break + } + + return e.complexity.InstrumentationOption.SpanKind(childComplexity), true + + case "InstrumentedApplicationDetails.conditions": + if e.complexity.InstrumentedApplicationDetails.Conditions == nil { + break + } + + return e.complexity.InstrumentedApplicationDetails.Conditions(childComplexity), true + + case "InstrumentedApplicationDetails.containers": + if e.complexity.InstrumentedApplicationDetails.Containers == nil { + break + } + + return e.complexity.InstrumentedApplicationDetails.Containers(childComplexity), true + + case "InstrumentedApplicationDetails.instrumentationOptions": + if e.complexity.InstrumentedApplicationDetails.InstrumentationOptions == nil { + break + } + + return e.complexity.InstrumentedApplicationDetails.InstrumentationOptions(childComplexity), true + + case "K8sActualNamespace.instrumentationLabelEnabled": + if e.complexity.K8sActualNamespace.InstrumentationLabelEnabled == nil { + break + } + + return e.complexity.K8sActualNamespace.InstrumentationLabelEnabled(childComplexity), true + + case "K8sActualNamespace.k8sActualSources": + if e.complexity.K8sActualNamespace.K8sActualSources == nil { + break + } + + args, err := ec.field_K8sActualNamespace_k8sActualSources_args(context.TODO(), rawArgs) + if err != nil { + return 0, false + } + + return e.complexity.K8sActualNamespace.K8sActualSources(childComplexity, args["instrumentationLabeled"].(*bool)), true + + case "K8sActualNamespace.name": + if e.complexity.K8sActualNamespace.Name == nil { + break + } + + return e.complexity.K8sActualNamespace.Name(childComplexity), true + + case "K8sActualSource.autoInstrumented": + if e.complexity.K8sActualSource.AutoInstrumented == nil { + break + } + + return e.complexity.K8sActualSource.AutoInstrumented(childComplexity), true + + case "K8sActualSource.autoInstrumentedDecision": + if e.complexity.K8sActualSource.AutoInstrumentedDecision == nil { + break + } + + return e.complexity.K8sActualSource.AutoInstrumentedDecision(childComplexity), true + + case "K8sActualSource.instrumentedApplicationDetails": + if e.complexity.K8sActualSource.InstrumentedApplicationDetails == nil { + break + } + + return e.complexity.K8sActualSource.InstrumentedApplicationDetails(childComplexity), true + + case "K8sActualSource.kind": + if e.complexity.K8sActualSource.Kind == nil { + break + } + + return e.complexity.K8sActualSource.Kind(childComplexity), true + + case "K8sActualSource.name": + if e.complexity.K8sActualSource.Name == nil { + break + } + + return e.complexity.K8sActualSource.Name(childComplexity), true + + case "K8sActualSource.namespace": + if e.complexity.K8sActualSource.Namespace == nil { + break + } + + return e.complexity.K8sActualSource.Namespace(childComplexity), true + + case "K8sActualSource.numberOfInstances": + if e.complexity.K8sActualSource.NumberOfInstances == nil { + break + } + + return e.complexity.K8sActualSource.NumberOfInstances(childComplexity), true + + case "K8sActualSource.reportedName": + if e.complexity.K8sActualSource.ReportedName == nil { + break + } + + return e.complexity.K8sActualSource.ReportedName(childComplexity), true + + case "K8sActualSource.serviceName": + if e.complexity.K8sActualSource.ServiceName == nil { + break + } + + return e.complexity.K8sActualSource.ServiceName(childComplexity), true + + case "Mutation.createNewDestination": + if e.complexity.Mutation.CreateNewDestination == nil { + break + } + + args, err := ec.field_Mutation_createNewDestination_args(context.TODO(), rawArgs) + if err != nil { + return 0, false + } + + return e.complexity.Mutation.CreateNewDestination(childComplexity, args["destination"].(model.DestinationInput)), true + + case "Mutation.persistK8sNamespace": + if e.complexity.Mutation.PersistK8sNamespace == nil { + break + } + + args, err := ec.field_Mutation_persistK8sNamespace_args(context.TODO(), rawArgs) + if err != nil { + return 0, false + } + + return e.complexity.Mutation.PersistK8sNamespace(childComplexity, args["namespace"].(model.PersistNamespaceItemInput)), true + + case "Mutation.persistK8sSources": + if e.complexity.Mutation.PersistK8sSources == nil { + break + } + + args, err := ec.field_Mutation_persistK8sSources_args(context.TODO(), rawArgs) + if err != nil { + return 0, false + } + + return e.complexity.Mutation.PersistK8sSources(childComplexity, args["namespace"].(string), args["sources"].([]*model.PersistNamespaceSourceInput)), true + + case "Mutation.testConnectionForDestination": + if e.complexity.Mutation.TestConnectionForDestination == nil { + break + } + + args, err := ec.field_Mutation_testConnectionForDestination_args(context.TODO(), rawArgs) + if err != nil { + return 0, false + } + + return e.complexity.Mutation.TestConnectionForDestination(childComplexity, args["destination"].(model.DestinationInput)), true + + case "Mutation.updateDestination": + if e.complexity.Mutation.UpdateDestination == nil { + break + } + + args, err := ec.field_Mutation_updateDestination_args(context.TODO(), rawArgs) + if err != nil { + return 0, false + } + + return e.complexity.Mutation.UpdateDestination(childComplexity, args["id"].(string), args["destination"].(model.DestinationInput)), true + + case "Mutation.updateK8sActualSource": + if e.complexity.Mutation.UpdateK8sActualSource == nil { + break + } + + args, err := ec.field_Mutation_updateK8sActualSource_args(context.TODO(), rawArgs) + if err != nil { + return 0, false + } + + return e.complexity.Mutation.UpdateK8sActualSource(childComplexity, args["sourceId"].(model.K8sSourceID), args["patchSourceRequest"].(model.PatchSourceRequestInput)), true + + case "ObservabilitySignalSupport.supported": + if e.complexity.ObservabilitySignalSupport.Supported == nil { + break + } + + return e.complexity.ObservabilitySignalSupport.Supported(childComplexity), true + + case "Query.computePlatform": + if e.complexity.Query.ComputePlatform == nil { + break + } + + return e.complexity.Query.ComputePlatform(childComplexity), true + + case "Query.config": + if e.complexity.Query.Config == nil { + break + } + + return e.complexity.Query.Config(childComplexity), true + + case "Query.destinationTypeDetails": + if e.complexity.Query.DestinationTypeDetails == nil { + break + } + + args, err := ec.field_Query_destinationTypeDetails_args(context.TODO(), rawArgs) + if err != nil { + return 0, false + } + + return e.complexity.Query.DestinationTypeDetails(childComplexity, args["type"].(string)), true + + case "Query.destinationTypes": + if e.complexity.Query.DestinationTypes == nil { + break + } + + return e.complexity.Query.DestinationTypes(childComplexity), true + + case "Query.potentialDestinations": + if e.complexity.Query.PotentialDestinations == nil { + break + } + + return e.complexity.Query.PotentialDestinations(childComplexity), true + + case "SourceContainerRuntimeDetails.containerName": + if e.complexity.SourceContainerRuntimeDetails.ContainerName == nil { + break + } + + return e.complexity.SourceContainerRuntimeDetails.ContainerName(childComplexity), true + + case "SourceContainerRuntimeDetails.language": + if e.complexity.SourceContainerRuntimeDetails.Language == nil { + break + } + + return e.complexity.SourceContainerRuntimeDetails.Language(childComplexity), true + + case "SupportedSignals.logs": + if e.complexity.SupportedSignals.Logs == nil { + break + } + + return e.complexity.SupportedSignals.Logs(childComplexity), true + + case "SupportedSignals.metrics": + if e.complexity.SupportedSignals.Metrics == nil { + break + } + + return e.complexity.SupportedSignals.Metrics(childComplexity), true + + case "SupportedSignals.traces": + if e.complexity.SupportedSignals.Traces == nil { + break + } + + return e.complexity.SupportedSignals.Traces(childComplexity), true + + case "TestConnectionResponse.destinationType": + if e.complexity.TestConnectionResponse.DestinationType == nil { + break + } + + return e.complexity.TestConnectionResponse.DestinationType(childComplexity), true + + case "TestConnectionResponse.message": + if e.complexity.TestConnectionResponse.Message == nil { + break + } + + return e.complexity.TestConnectionResponse.Message(childComplexity), true + + case "TestConnectionResponse.reason": + if e.complexity.TestConnectionResponse.Reason == nil { + break + } + + return e.complexity.TestConnectionResponse.Reason(childComplexity), true + + case "TestConnectionResponse.statusCode": + if e.complexity.TestConnectionResponse.StatusCode == nil { + break + } + + return e.complexity.TestConnectionResponse.StatusCode(childComplexity), true + + case "TestConnectionResponse.succeeded": + if e.complexity.TestConnectionResponse.Succeeded == nil { + break + } + + return e.complexity.TestConnectionResponse.Succeeded(childComplexity), true + + } + return 0, false +} + +func (e *executableSchema) Exec(ctx context.Context) graphql.ResponseHandler { + rc := graphql.GetOperationContext(ctx) + ec := executionContext{rc, e, 0, 0, make(chan graphql.DeferredResult)} + inputUnmarshalMap := graphql.BuildUnmarshalerMap( + ec.unmarshalInputDestinationInput, + ec.unmarshalInputExportedSignalsInput, + ec.unmarshalInputFieldInput, + ec.unmarshalInputK8sDesiredNamespaceInput, + ec.unmarshalInputK8sDesiredSourceInput, + ec.unmarshalInputK8sNamespaceId, + ec.unmarshalInputK8sSourceId, + ec.unmarshalInputPatchSourceRequestInput, + ec.unmarshalInputPersistNamespaceItemInput, + ec.unmarshalInputPersistNamespaceSourceInput, + ) + first := true + + switch rc.Operation.Operation { + case ast.Query: + return func(ctx context.Context) *graphql.Response { + var response graphql.Response + var data graphql.Marshaler + if first { + first = false + ctx = graphql.WithUnmarshalerMap(ctx, inputUnmarshalMap) + data = ec._Query(ctx, rc.Operation.SelectionSet) + } else { + if atomic.LoadInt32(&ec.pendingDeferred) > 0 { + result := <-ec.deferredResults + atomic.AddInt32(&ec.pendingDeferred, -1) + data = result.Result + response.Path = result.Path + response.Label = result.Label + response.Errors = result.Errors + } else { + return nil + } + } + var buf bytes.Buffer + data.MarshalGQL(&buf) + response.Data = buf.Bytes() + if atomic.LoadInt32(&ec.deferred) > 0 { + hasNext := atomic.LoadInt32(&ec.pendingDeferred) > 0 + response.HasNext = &hasNext + } + + return &response + } + case ast.Mutation: + return func(ctx context.Context) *graphql.Response { + if !first { + return nil + } + first = false + ctx = graphql.WithUnmarshalerMap(ctx, inputUnmarshalMap) + data := ec._Mutation(ctx, rc.Operation.SelectionSet) + var buf bytes.Buffer + data.MarshalGQL(&buf) + + return &graphql.Response{ + Data: buf.Bytes(), + } + } + + default: + return graphql.OneShot(graphql.ErrorResponse(ctx, "unsupported GraphQL operation")) + } +} + +type executionContext struct { + *graphql.OperationContext + *executableSchema + deferred int32 + pendingDeferred int32 + deferredResults chan graphql.DeferredResult +} + +func (ec *executionContext) processDeferredGroup(dg graphql.DeferredGroup) { + atomic.AddInt32(&ec.pendingDeferred, 1) + go func() { + ctx := graphql.WithFreshResponseContext(dg.Context) + dg.FieldSet.Dispatch(ctx) + ds := graphql.DeferredResult{ + Path: dg.Path, + Label: dg.Label, + Result: dg.FieldSet, + Errors: graphql.GetErrors(ctx), + } + // null fields should bubble up + if dg.FieldSet.Invalids > 0 { + ds.Result = graphql.Null + } + ec.deferredResults <- ds + }() +} + +func (ec *executionContext) introspectSchema() (*introspection.Schema, error) { + if ec.DisableIntrospection { + return nil, errors.New("introspection disabled") + } + return introspection.WrapSchema(ec.Schema()), nil +} + +func (ec *executionContext) introspectType(name string) (*introspection.Type, error) { + if ec.DisableIntrospection { + return nil, errors.New("introspection disabled") + } + return introspection.WrapTypeFromDef(ec.Schema(), ec.Schema().Types[name]), nil +} + +//go:embed "schema.graphqls" +var sourcesFS embed.FS + +func sourceData(filename string) string { + data, err := sourcesFS.ReadFile(filename) + if err != nil { + panic(fmt.Sprintf("codegen problem: %s not available", filename)) + } + return string(data) +} + +var sources = []*ast.Source{ + {Name: "schema.graphqls", Input: sourceData("schema.graphqls"), BuiltIn: false}, +} +var parsedSchema = gqlparser.MustLoadSchema(sources...) + +// endregion ************************** generated!.gotpl ************************** + +// region ***************************** args.gotpl ***************************** + +func (ec *executionContext) field_ComputePlatform_k8sActualNamespace_args(ctx context.Context, rawArgs map[string]interface{}) (map[string]interface{}, error) { + var err error + args := map[string]interface{}{} + var arg0 string + if tmp, ok := rawArgs["name"]; ok { + ctx := graphql.WithPathContext(ctx, graphql.NewPathWithField("name")) + arg0, err = ec.unmarshalNString2string(ctx, tmp) + if err != nil { + return nil, err + } + } + args["name"] = arg0 + return args, nil +} + +func (ec *executionContext) field_ComputePlatform_k8sActualSource_args(ctx context.Context, rawArgs map[string]interface{}) (map[string]interface{}, error) { + var err error + args := map[string]interface{}{} + var arg0 *string + if tmp, ok := rawArgs["name"]; ok { + ctx := graphql.WithPathContext(ctx, graphql.NewPathWithField("name")) + arg0, err = ec.unmarshalOString2ᚖstring(ctx, tmp) + if err != nil { + return nil, err + } + } + args["name"] = arg0 + var arg1 *string + if tmp, ok := rawArgs["namespace"]; ok { + ctx := graphql.WithPathContext(ctx, graphql.NewPathWithField("namespace")) + arg1, err = ec.unmarshalOString2ᚖstring(ctx, tmp) + if err != nil { + return nil, err + } + } + args["namespace"] = arg1 + var arg2 *string + if tmp, ok := rawArgs["kind"]; ok { + ctx := graphql.WithPathContext(ctx, graphql.NewPathWithField("kind")) + arg2, err = ec.unmarshalOString2ᚖstring(ctx, tmp) + if err != nil { + return nil, err + } + } + args["kind"] = arg2 + return args, nil +} + +func (ec *executionContext) field_K8sActualNamespace_k8sActualSources_args(ctx context.Context, rawArgs map[string]interface{}) (map[string]interface{}, error) { + var err error + args := map[string]interface{}{} + var arg0 *bool + if tmp, ok := rawArgs["instrumentationLabeled"]; ok { + ctx := graphql.WithPathContext(ctx, graphql.NewPathWithField("instrumentationLabeled")) + arg0, err = ec.unmarshalOBoolean2ᚖbool(ctx, tmp) + if err != nil { + return nil, err + } + } + args["instrumentationLabeled"] = arg0 + return args, nil +} + +func (ec *executionContext) field_Mutation_createNewDestination_args(ctx context.Context, rawArgs map[string]interface{}) (map[string]interface{}, error) { + var err error + args := map[string]interface{}{} + var arg0 model.DestinationInput + if tmp, ok := rawArgs["destination"]; ok { + ctx := graphql.WithPathContext(ctx, graphql.NewPathWithField("destination")) + arg0, err = ec.unmarshalNDestinationInput2githubᚗcomᚋodigosᚑioᚋodigosᚋfrontendᚋgraphᚋmodelᚐDestinationInput(ctx, tmp) + if err != nil { + return nil, err + } + } + args["destination"] = arg0 + return args, nil +} + +func (ec *executionContext) field_Mutation_persistK8sNamespace_args(ctx context.Context, rawArgs map[string]interface{}) (map[string]interface{}, error) { + var err error + args := map[string]interface{}{} + var arg0 model.PersistNamespaceItemInput + if tmp, ok := rawArgs["namespace"]; ok { + ctx := graphql.WithPathContext(ctx, graphql.NewPathWithField("namespace")) + arg0, err = ec.unmarshalNPersistNamespaceItemInput2githubᚗcomᚋodigosᚑioᚋodigosᚋfrontendᚋgraphᚋmodelᚐPersistNamespaceItemInput(ctx, tmp) + if err != nil { + return nil, err + } + } + args["namespace"] = arg0 + return args, nil +} + +func (ec *executionContext) field_Mutation_persistK8sSources_args(ctx context.Context, rawArgs map[string]interface{}) (map[string]interface{}, error) { + var err error + args := map[string]interface{}{} + var arg0 string + if tmp, ok := rawArgs["namespace"]; ok { + ctx := graphql.WithPathContext(ctx, graphql.NewPathWithField("namespace")) + arg0, err = ec.unmarshalNString2string(ctx, tmp) + if err != nil { + return nil, err + } + } + args["namespace"] = arg0 + var arg1 []*model.PersistNamespaceSourceInput + if tmp, ok := rawArgs["sources"]; ok { + ctx := graphql.WithPathContext(ctx, graphql.NewPathWithField("sources")) + arg1, err = ec.unmarshalNPersistNamespaceSourceInput2ᚕᚖgithubᚗcomᚋodigosᚑioᚋodigosᚋfrontendᚋgraphᚋmodelᚐPersistNamespaceSourceInputᚄ(ctx, tmp) + if err != nil { + return nil, err + } + } + args["sources"] = arg1 + return args, nil +} + +func (ec *executionContext) field_Mutation_testConnectionForDestination_args(ctx context.Context, rawArgs map[string]interface{}) (map[string]interface{}, error) { + var err error + args := map[string]interface{}{} + var arg0 model.DestinationInput + if tmp, ok := rawArgs["destination"]; ok { + ctx := graphql.WithPathContext(ctx, graphql.NewPathWithField("destination")) + arg0, err = ec.unmarshalNDestinationInput2githubᚗcomᚋodigosᚑioᚋodigosᚋfrontendᚋgraphᚋmodelᚐDestinationInput(ctx, tmp) + if err != nil { + return nil, err + } + } + args["destination"] = arg0 + return args, nil +} + +func (ec *executionContext) field_Mutation_updateDestination_args(ctx context.Context, rawArgs map[string]interface{}) (map[string]interface{}, error) { + var err error + args := map[string]interface{}{} + var arg0 string + if tmp, ok := rawArgs["id"]; ok { + ctx := graphql.WithPathContext(ctx, graphql.NewPathWithField("id")) + arg0, err = ec.unmarshalNID2string(ctx, tmp) + if err != nil { + return nil, err + } + } + args["id"] = arg0 + var arg1 model.DestinationInput + if tmp, ok := rawArgs["destination"]; ok { + ctx := graphql.WithPathContext(ctx, graphql.NewPathWithField("destination")) + arg1, err = ec.unmarshalNDestinationInput2githubᚗcomᚋodigosᚑioᚋodigosᚋfrontendᚋgraphᚋmodelᚐDestinationInput(ctx, tmp) + if err != nil { + return nil, err + } + } + args["destination"] = arg1 + return args, nil +} + +func (ec *executionContext) field_Mutation_updateK8sActualSource_args(ctx context.Context, rawArgs map[string]interface{}) (map[string]interface{}, error) { + var err error + args := map[string]interface{}{} + var arg0 model.K8sSourceID + if tmp, ok := rawArgs["sourceId"]; ok { + ctx := graphql.WithPathContext(ctx, graphql.NewPathWithField("sourceId")) + arg0, err = ec.unmarshalNK8sSourceId2githubᚗcomᚋodigosᚑioᚋodigosᚋfrontendᚋgraphᚋmodelᚐK8sSourceID(ctx, tmp) + if err != nil { + return nil, err + } + } + args["sourceId"] = arg0 + var arg1 model.PatchSourceRequestInput + if tmp, ok := rawArgs["patchSourceRequest"]; ok { + ctx := graphql.WithPathContext(ctx, graphql.NewPathWithField("patchSourceRequest")) + arg1, err = ec.unmarshalNPatchSourceRequestInput2githubᚗcomᚋodigosᚑioᚋodigosᚋfrontendᚋgraphᚋmodelᚐPatchSourceRequestInput(ctx, tmp) + if err != nil { + return nil, err + } + } + args["patchSourceRequest"] = arg1 + return args, nil +} + +func (ec *executionContext) field_Query___type_args(ctx context.Context, rawArgs map[string]interface{}) (map[string]interface{}, error) { + var err error + args := map[string]interface{}{} + var arg0 string + if tmp, ok := rawArgs["name"]; ok { + ctx := graphql.WithPathContext(ctx, graphql.NewPathWithField("name")) + arg0, err = ec.unmarshalNString2string(ctx, tmp) + if err != nil { + return nil, err + } + } + args["name"] = arg0 + return args, nil +} + +func (ec *executionContext) field_Query_destinationTypeDetails_args(ctx context.Context, rawArgs map[string]interface{}) (map[string]interface{}, error) { + var err error + args := map[string]interface{}{} + var arg0 string + if tmp, ok := rawArgs["type"]; ok { + ctx := graphql.WithPathContext(ctx, graphql.NewPathWithField("type")) + arg0, err = ec.unmarshalNString2string(ctx, tmp) + if err != nil { + return nil, err + } + } + args["type"] = arg0 + return args, nil +} + +func (ec *executionContext) field___Type_enumValues_args(ctx context.Context, rawArgs map[string]interface{}) (map[string]interface{}, error) { + var err error + args := map[string]interface{}{} + var arg0 bool + if tmp, ok := rawArgs["includeDeprecated"]; ok { + ctx := graphql.WithPathContext(ctx, graphql.NewPathWithField("includeDeprecated")) + arg0, err = ec.unmarshalOBoolean2bool(ctx, tmp) + if err != nil { + return nil, err + } + } + args["includeDeprecated"] = arg0 + return args, nil +} + +func (ec *executionContext) field___Type_fields_args(ctx context.Context, rawArgs map[string]interface{}) (map[string]interface{}, error) { + var err error + args := map[string]interface{}{} + var arg0 bool + if tmp, ok := rawArgs["includeDeprecated"]; ok { + ctx := graphql.WithPathContext(ctx, graphql.NewPathWithField("includeDeprecated")) + arg0, err = ec.unmarshalOBoolean2bool(ctx, tmp) + if err != nil { + return nil, err + } + } + args["includeDeprecated"] = arg0 + return args, nil +} + +// endregion ***************************** args.gotpl ***************************** + +// region ************************** directives.gotpl ************************** + +// endregion ************************** directives.gotpl ************************** + +// region **************************** field.gotpl ***************************** + +func (ec *executionContext) _ComputePlatform_computePlatformType(ctx context.Context, field graphql.CollectedField, obj *model.ComputePlatform) (ret graphql.Marshaler) { + fc, err := ec.fieldContext_ComputePlatform_computePlatformType(ctx, field) + if err != nil { + return graphql.Null + } + ctx = graphql.WithFieldContext(ctx, fc) + defer func() { + if r := recover(); r != nil { + ec.Error(ctx, ec.Recover(ctx, r)) + ret = graphql.Null + } + }() + resTmp, err := ec.ResolverMiddleware(ctx, func(rctx context.Context) (interface{}, error) { + ctx = rctx // use context from middleware stack in children + return obj.ComputePlatformType, nil + }) + if err != nil { + ec.Error(ctx, err) + return graphql.Null + } + if resTmp == nil { + if !graphql.HasFieldError(ctx, fc) { + ec.Errorf(ctx, "must not be null") + } + return graphql.Null + } + res := resTmp.(model.ComputePlatformType) + fc.Result = res + return ec.marshalNComputePlatformType2githubᚗcomᚋodigosᚑioᚋodigosᚋfrontendᚋgraphᚋmodelᚐComputePlatformType(ctx, field.Selections, res) +} + +func (ec *executionContext) fieldContext_ComputePlatform_computePlatformType(_ context.Context, field graphql.CollectedField) (fc *graphql.FieldContext, err error) { + fc = &graphql.FieldContext{ + Object: "ComputePlatform", + Field: field, + IsMethod: false, + IsResolver: false, + Child: func(ctx context.Context, field graphql.CollectedField) (*graphql.FieldContext, error) { + return nil, errors.New("field of type ComputePlatformType does not have child fields") + }, + } + return fc, nil +} + +func (ec *executionContext) _ComputePlatform_k8sActualNamespace(ctx context.Context, field graphql.CollectedField, obj *model.ComputePlatform) (ret graphql.Marshaler) { + fc, err := ec.fieldContext_ComputePlatform_k8sActualNamespace(ctx, field) + if err != nil { + return graphql.Null + } + ctx = graphql.WithFieldContext(ctx, fc) + defer func() { + if r := recover(); r != nil { + ec.Error(ctx, ec.Recover(ctx, r)) + ret = graphql.Null + } + }() + resTmp, err := ec.ResolverMiddleware(ctx, func(rctx context.Context) (interface{}, error) { + ctx = rctx // use context from middleware stack in children + return ec.resolvers.ComputePlatform().K8sActualNamespace(rctx, obj, fc.Args["name"].(string)) + }) + if err != nil { + ec.Error(ctx, err) + return graphql.Null + } + if resTmp == nil { + return graphql.Null + } + res := resTmp.(*model.K8sActualNamespace) + fc.Result = res + return ec.marshalOK8sActualNamespace2ᚖgithubᚗcomᚋodigosᚑioᚋodigosᚋfrontendᚋgraphᚋmodelᚐK8sActualNamespace(ctx, field.Selections, res) +} + +func (ec *executionContext) fieldContext_ComputePlatform_k8sActualNamespace(ctx context.Context, field graphql.CollectedField) (fc *graphql.FieldContext, err error) { + fc = &graphql.FieldContext{ + Object: "ComputePlatform", + Field: field, + IsMethod: true, + IsResolver: true, + Child: func(ctx context.Context, field graphql.CollectedField) (*graphql.FieldContext, error) { + switch field.Name { + case "name": + return ec.fieldContext_K8sActualNamespace_name(ctx, field) + case "instrumentationLabelEnabled": + return ec.fieldContext_K8sActualNamespace_instrumentationLabelEnabled(ctx, field) + case "k8sActualSources": + return ec.fieldContext_K8sActualNamespace_k8sActualSources(ctx, field) + } + return nil, fmt.Errorf("no field named %q was found under type K8sActualNamespace", field.Name) + }, + } + defer func() { + if r := recover(); r != nil { + err = ec.Recover(ctx, r) + ec.Error(ctx, err) + } + }() + ctx = graphql.WithFieldContext(ctx, fc) + if fc.Args, err = ec.field_ComputePlatform_k8sActualNamespace_args(ctx, field.ArgumentMap(ec.Variables)); err != nil { + ec.Error(ctx, err) + return fc, err + } + return fc, nil +} + +func (ec *executionContext) _ComputePlatform_k8sActualNamespaces(ctx context.Context, field graphql.CollectedField, obj *model.ComputePlatform) (ret graphql.Marshaler) { + fc, err := ec.fieldContext_ComputePlatform_k8sActualNamespaces(ctx, field) + if err != nil { + return graphql.Null + } + ctx = graphql.WithFieldContext(ctx, fc) + defer func() { + if r := recover(); r != nil { + ec.Error(ctx, ec.Recover(ctx, r)) + ret = graphql.Null + } + }() + resTmp, err := ec.ResolverMiddleware(ctx, func(rctx context.Context) (interface{}, error) { + ctx = rctx // use context from middleware stack in children + return ec.resolvers.ComputePlatform().K8sActualNamespaces(rctx, obj) + }) + if err != nil { + ec.Error(ctx, err) + return graphql.Null + } + if resTmp == nil { + if !graphql.HasFieldError(ctx, fc) { + ec.Errorf(ctx, "must not be null") + } + return graphql.Null + } + res := resTmp.([]*model.K8sActualNamespace) + fc.Result = res + return ec.marshalNK8sActualNamespace2ᚕᚖgithubᚗcomᚋodigosᚑioᚋodigosᚋfrontendᚋgraphᚋmodelᚐK8sActualNamespace(ctx, field.Selections, res) +} + +func (ec *executionContext) fieldContext_ComputePlatform_k8sActualNamespaces(_ context.Context, field graphql.CollectedField) (fc *graphql.FieldContext, err error) { + fc = &graphql.FieldContext{ + Object: "ComputePlatform", + Field: field, + IsMethod: true, + IsResolver: true, + Child: func(ctx context.Context, field graphql.CollectedField) (*graphql.FieldContext, error) { + switch field.Name { + case "name": + return ec.fieldContext_K8sActualNamespace_name(ctx, field) + case "instrumentationLabelEnabled": + return ec.fieldContext_K8sActualNamespace_instrumentationLabelEnabled(ctx, field) + case "k8sActualSources": + return ec.fieldContext_K8sActualNamespace_k8sActualSources(ctx, field) + } + return nil, fmt.Errorf("no field named %q was found under type K8sActualNamespace", field.Name) + }, + } + return fc, nil +} + +func (ec *executionContext) _ComputePlatform_k8sActualSource(ctx context.Context, field graphql.CollectedField, obj *model.ComputePlatform) (ret graphql.Marshaler) { + fc, err := ec.fieldContext_ComputePlatform_k8sActualSource(ctx, field) + if err != nil { + return graphql.Null + } + ctx = graphql.WithFieldContext(ctx, fc) + defer func() { + if r := recover(); r != nil { + ec.Error(ctx, ec.Recover(ctx, r)) + ret = graphql.Null + } + }() + resTmp, err := ec.ResolverMiddleware(ctx, func(rctx context.Context) (interface{}, error) { + ctx = rctx // use context from middleware stack in children + return ec.resolvers.ComputePlatform().K8sActualSource(rctx, obj, fc.Args["name"].(*string), fc.Args["namespace"].(*string), fc.Args["kind"].(*string)) + }) + if err != nil { + ec.Error(ctx, err) + return graphql.Null + } + if resTmp == nil { + return graphql.Null + } + res := resTmp.(*model.K8sActualSource) + fc.Result = res + return ec.marshalOK8sActualSource2ᚖgithubᚗcomᚋodigosᚑioᚋodigosᚋfrontendᚋgraphᚋmodelᚐK8sActualSource(ctx, field.Selections, res) +} + +func (ec *executionContext) fieldContext_ComputePlatform_k8sActualSource(ctx context.Context, field graphql.CollectedField) (fc *graphql.FieldContext, err error) { + fc = &graphql.FieldContext{ + Object: "ComputePlatform", + Field: field, + IsMethod: true, + IsResolver: true, + Child: func(ctx context.Context, field graphql.CollectedField) (*graphql.FieldContext, error) { + switch field.Name { + case "namespace": + return ec.fieldContext_K8sActualSource_namespace(ctx, field) + case "kind": + return ec.fieldContext_K8sActualSource_kind(ctx, field) + case "name": + return ec.fieldContext_K8sActualSource_name(ctx, field) + case "serviceName": + return ec.fieldContext_K8sActualSource_serviceName(ctx, field) + case "numberOfInstances": + return ec.fieldContext_K8sActualSource_numberOfInstances(ctx, field) + case "reportedName": + return ec.fieldContext_K8sActualSource_reportedName(ctx, field) + case "autoInstrumented": + return ec.fieldContext_K8sActualSource_autoInstrumented(ctx, field) + case "autoInstrumentedDecision": + return ec.fieldContext_K8sActualSource_autoInstrumentedDecision(ctx, field) + case "instrumentedApplicationDetails": + return ec.fieldContext_K8sActualSource_instrumentedApplicationDetails(ctx, field) + } + return nil, fmt.Errorf("no field named %q was found under type K8sActualSource", field.Name) + }, + } + defer func() { + if r := recover(); r != nil { + err = ec.Recover(ctx, r) + ec.Error(ctx, err) + } + }() + ctx = graphql.WithFieldContext(ctx, fc) + if fc.Args, err = ec.field_ComputePlatform_k8sActualSource_args(ctx, field.ArgumentMap(ec.Variables)); err != nil { + ec.Error(ctx, err) + return fc, err + } + return fc, nil +} + +func (ec *executionContext) _ComputePlatform_k8sActualSources(ctx context.Context, field graphql.CollectedField, obj *model.ComputePlatform) (ret graphql.Marshaler) { + fc, err := ec.fieldContext_ComputePlatform_k8sActualSources(ctx, field) + if err != nil { + return graphql.Null + } + ctx = graphql.WithFieldContext(ctx, fc) + defer func() { + if r := recover(); r != nil { + ec.Error(ctx, ec.Recover(ctx, r)) + ret = graphql.Null + } + }() + resTmp, err := ec.ResolverMiddleware(ctx, func(rctx context.Context) (interface{}, error) { + ctx = rctx // use context from middleware stack in children + return ec.resolvers.ComputePlatform().K8sActualSources(rctx, obj) + }) + if err != nil { + ec.Error(ctx, err) + return graphql.Null + } + if resTmp == nil { + if !graphql.HasFieldError(ctx, fc) { + ec.Errorf(ctx, "must not be null") + } + return graphql.Null + } + res := resTmp.([]*model.K8sActualSource) + fc.Result = res + return ec.marshalNK8sActualSource2ᚕᚖgithubᚗcomᚋodigosᚑioᚋodigosᚋfrontendᚋgraphᚋmodelᚐK8sActualSource(ctx, field.Selections, res) +} + +func (ec *executionContext) fieldContext_ComputePlatform_k8sActualSources(_ context.Context, field graphql.CollectedField) (fc *graphql.FieldContext, err error) { + fc = &graphql.FieldContext{ + Object: "ComputePlatform", + Field: field, + IsMethod: true, + IsResolver: true, + Child: func(ctx context.Context, field graphql.CollectedField) (*graphql.FieldContext, error) { + switch field.Name { + case "namespace": + return ec.fieldContext_K8sActualSource_namespace(ctx, field) + case "kind": + return ec.fieldContext_K8sActualSource_kind(ctx, field) + case "name": + return ec.fieldContext_K8sActualSource_name(ctx, field) + case "serviceName": + return ec.fieldContext_K8sActualSource_serviceName(ctx, field) + case "numberOfInstances": + return ec.fieldContext_K8sActualSource_numberOfInstances(ctx, field) + case "reportedName": + return ec.fieldContext_K8sActualSource_reportedName(ctx, field) + case "autoInstrumented": + return ec.fieldContext_K8sActualSource_autoInstrumented(ctx, field) + case "autoInstrumentedDecision": + return ec.fieldContext_K8sActualSource_autoInstrumentedDecision(ctx, field) + case "instrumentedApplicationDetails": + return ec.fieldContext_K8sActualSource_instrumentedApplicationDetails(ctx, field) + } + return nil, fmt.Errorf("no field named %q was found under type K8sActualSource", field.Name) + }, + } + return fc, nil +} + +func (ec *executionContext) _ComputePlatform_destinations(ctx context.Context, field graphql.CollectedField, obj *model.ComputePlatform) (ret graphql.Marshaler) { + fc, err := ec.fieldContext_ComputePlatform_destinations(ctx, field) + if err != nil { + return graphql.Null + } + ctx = graphql.WithFieldContext(ctx, fc) + defer func() { + if r := recover(); r != nil { + ec.Error(ctx, ec.Recover(ctx, r)) + ret = graphql.Null + } + }() + resTmp, err := ec.ResolverMiddleware(ctx, func(rctx context.Context) (interface{}, error) { + ctx = rctx // use context from middleware stack in children + return ec.resolvers.ComputePlatform().Destinations(rctx, obj) + }) + if err != nil { + ec.Error(ctx, err) + return graphql.Null + } + if resTmp == nil { + if !graphql.HasFieldError(ctx, fc) { + ec.Errorf(ctx, "must not be null") + } + return graphql.Null + } + res := resTmp.([]*model.Destination) + fc.Result = res + return ec.marshalNDestination2ᚕᚖgithubᚗcomᚋodigosᚑioᚋodigosᚋfrontendᚋgraphᚋmodelᚐDestinationᚄ(ctx, field.Selections, res) +} + +func (ec *executionContext) fieldContext_ComputePlatform_destinations(_ context.Context, field graphql.CollectedField) (fc *graphql.FieldContext, err error) { + fc = &graphql.FieldContext{ + Object: "ComputePlatform", + Field: field, + IsMethod: true, + IsResolver: true, + Child: func(ctx context.Context, field graphql.CollectedField) (*graphql.FieldContext, error) { + switch field.Name { + case "id": + return ec.fieldContext_Destination_id(ctx, field) + case "name": + return ec.fieldContext_Destination_name(ctx, field) + case "type": + return ec.fieldContext_Destination_type(ctx, field) + case "exportedSignals": + return ec.fieldContext_Destination_exportedSignals(ctx, field) + case "fields": + return ec.fieldContext_Destination_fields(ctx, field) + case "destinationType": + return ec.fieldContext_Destination_destinationType(ctx, field) + case "conditions": + return ec.fieldContext_Destination_conditions(ctx, field) + } + return nil, fmt.Errorf("no field named %q was found under type Destination", field.Name) + }, + } + return fc, nil +} + +func (ec *executionContext) _ComputePlatform_actions(ctx context.Context, field graphql.CollectedField, obj *model.ComputePlatform) (ret graphql.Marshaler) { + fc, err := ec.fieldContext_ComputePlatform_actions(ctx, field) + if err != nil { + return graphql.Null + } + ctx = graphql.WithFieldContext(ctx, fc) + defer func() { + if r := recover(); r != nil { + ec.Error(ctx, ec.Recover(ctx, r)) + ret = graphql.Null + } + }() + resTmp, err := ec.ResolverMiddleware(ctx, func(rctx context.Context) (interface{}, error) { + ctx = rctx // use context from middleware stack in children + return ec.resolvers.ComputePlatform().Actions(rctx, obj) + }) + if err != nil { + ec.Error(ctx, err) + return graphql.Null + } + if resTmp == nil { + if !graphql.HasFieldError(ctx, fc) { + ec.Errorf(ctx, "must not be null") + } + return graphql.Null + } + res := resTmp.([]*model.IcaInstanceResponse) + fc.Result = res + return ec.marshalNIcaInstanceResponse2ᚕᚖgithubᚗcomᚋodigosᚑioᚋodigosᚋfrontendᚋgraphᚋmodelᚐIcaInstanceResponseᚄ(ctx, field.Selections, res) +} + +func (ec *executionContext) fieldContext_ComputePlatform_actions(_ context.Context, field graphql.CollectedField) (fc *graphql.FieldContext, err error) { + fc = &graphql.FieldContext{ + Object: "ComputePlatform", + Field: field, + IsMethod: true, + IsResolver: true, + Child: func(ctx context.Context, field graphql.CollectedField) (*graphql.FieldContext, error) { + switch field.Name { + case "id": + return ec.fieldContext_IcaInstanceResponse_id(ctx, field) + case "type": + return ec.fieldContext_IcaInstanceResponse_type(ctx, field) + case "spec": + return ec.fieldContext_IcaInstanceResponse_spec(ctx, field) + } + return nil, fmt.Errorf("no field named %q was found under type IcaInstanceResponse", field.Name) + }, + } + return fc, nil +} + +func (ec *executionContext) _Condition_type(ctx context.Context, field graphql.CollectedField, obj *model.Condition) (ret graphql.Marshaler) { + fc, err := ec.fieldContext_Condition_type(ctx, field) + if err != nil { + return graphql.Null + } + ctx = graphql.WithFieldContext(ctx, fc) + defer func() { + if r := recover(); r != nil { + ec.Error(ctx, ec.Recover(ctx, r)) + ret = graphql.Null + } + }() + resTmp, err := ec.ResolverMiddleware(ctx, func(rctx context.Context) (interface{}, error) { + ctx = rctx // use context from middleware stack in children + return obj.Type, nil + }) + if err != nil { + ec.Error(ctx, err) + return graphql.Null + } + if resTmp == nil { + if !graphql.HasFieldError(ctx, fc) { + ec.Errorf(ctx, "must not be null") + } + return graphql.Null + } + res := resTmp.(string) + fc.Result = res + return ec.marshalNString2string(ctx, field.Selections, res) +} + +func (ec *executionContext) fieldContext_Condition_type(_ context.Context, field graphql.CollectedField) (fc *graphql.FieldContext, err error) { + fc = &graphql.FieldContext{ + Object: "Condition", + Field: field, + IsMethod: false, + IsResolver: false, + Child: func(ctx context.Context, field graphql.CollectedField) (*graphql.FieldContext, error) { + return nil, errors.New("field of type String does not have child fields") + }, + } + return fc, nil +} + +func (ec *executionContext) _Condition_status(ctx context.Context, field graphql.CollectedField, obj *model.Condition) (ret graphql.Marshaler) { + fc, err := ec.fieldContext_Condition_status(ctx, field) + if err != nil { + return graphql.Null + } + ctx = graphql.WithFieldContext(ctx, fc) + defer func() { + if r := recover(); r != nil { + ec.Error(ctx, ec.Recover(ctx, r)) + ret = graphql.Null + } + }() + resTmp, err := ec.ResolverMiddleware(ctx, func(rctx context.Context) (interface{}, error) { + ctx = rctx // use context from middleware stack in children + return obj.Status, nil + }) + if err != nil { + ec.Error(ctx, err) + return graphql.Null + } + if resTmp == nil { + if !graphql.HasFieldError(ctx, fc) { + ec.Errorf(ctx, "must not be null") + } + return graphql.Null + } + res := resTmp.(model.ConditionStatus) + fc.Result = res + return ec.marshalNConditionStatus2githubᚗcomᚋodigosᚑioᚋodigosᚋfrontendᚋgraphᚋmodelᚐConditionStatus(ctx, field.Selections, res) +} + +func (ec *executionContext) fieldContext_Condition_status(_ context.Context, field graphql.CollectedField) (fc *graphql.FieldContext, err error) { + fc = &graphql.FieldContext{ + Object: "Condition", + Field: field, + IsMethod: false, + IsResolver: false, + Child: func(ctx context.Context, field graphql.CollectedField) (*graphql.FieldContext, error) { + return nil, errors.New("field of type ConditionStatus does not have child fields") + }, + } + return fc, nil +} + +func (ec *executionContext) _Condition_lastTransitionTime(ctx context.Context, field graphql.CollectedField, obj *model.Condition) (ret graphql.Marshaler) { + fc, err := ec.fieldContext_Condition_lastTransitionTime(ctx, field) + if err != nil { + return graphql.Null + } + ctx = graphql.WithFieldContext(ctx, fc) + defer func() { + if r := recover(); r != nil { + ec.Error(ctx, ec.Recover(ctx, r)) + ret = graphql.Null + } + }() + resTmp, err := ec.ResolverMiddleware(ctx, func(rctx context.Context) (interface{}, error) { + ctx = rctx // use context from middleware stack in children + return obj.LastTransitionTime, nil + }) + if err != nil { + ec.Error(ctx, err) + return graphql.Null + } + if resTmp == nil { + return graphql.Null + } + res := resTmp.(*string) + fc.Result = res + return ec.marshalOString2ᚖstring(ctx, field.Selections, res) +} + +func (ec *executionContext) fieldContext_Condition_lastTransitionTime(_ context.Context, field graphql.CollectedField) (fc *graphql.FieldContext, err error) { + fc = &graphql.FieldContext{ + Object: "Condition", + Field: field, + IsMethod: false, + IsResolver: false, + Child: func(ctx context.Context, field graphql.CollectedField) (*graphql.FieldContext, error) { + return nil, errors.New("field of type String does not have child fields") + }, + } + return fc, nil +} + +func (ec *executionContext) _Condition_reason(ctx context.Context, field graphql.CollectedField, obj *model.Condition) (ret graphql.Marshaler) { + fc, err := ec.fieldContext_Condition_reason(ctx, field) + if err != nil { + return graphql.Null + } + ctx = graphql.WithFieldContext(ctx, fc) + defer func() { + if r := recover(); r != nil { + ec.Error(ctx, ec.Recover(ctx, r)) + ret = graphql.Null + } + }() + resTmp, err := ec.ResolverMiddleware(ctx, func(rctx context.Context) (interface{}, error) { + ctx = rctx // use context from middleware stack in children + return obj.Reason, nil + }) + if err != nil { + ec.Error(ctx, err) + return graphql.Null + } + if resTmp == nil { + return graphql.Null + } + res := resTmp.(*string) + fc.Result = res + return ec.marshalOString2ᚖstring(ctx, field.Selections, res) +} + +func (ec *executionContext) fieldContext_Condition_reason(_ context.Context, field graphql.CollectedField) (fc *graphql.FieldContext, err error) { + fc = &graphql.FieldContext{ + Object: "Condition", + Field: field, + IsMethod: false, + IsResolver: false, + Child: func(ctx context.Context, field graphql.CollectedField) (*graphql.FieldContext, error) { + return nil, errors.New("field of type String does not have child fields") + }, + } + return fc, nil +} + +func (ec *executionContext) _Condition_message(ctx context.Context, field graphql.CollectedField, obj *model.Condition) (ret graphql.Marshaler) { + fc, err := ec.fieldContext_Condition_message(ctx, field) + if err != nil { + return graphql.Null + } + ctx = graphql.WithFieldContext(ctx, fc) + defer func() { + if r := recover(); r != nil { + ec.Error(ctx, ec.Recover(ctx, r)) + ret = graphql.Null + } + }() + resTmp, err := ec.ResolverMiddleware(ctx, func(rctx context.Context) (interface{}, error) { + ctx = rctx // use context from middleware stack in children + return obj.Message, nil + }) + if err != nil { + ec.Error(ctx, err) + return graphql.Null + } + if resTmp == nil { + return graphql.Null + } + res := resTmp.(*string) + fc.Result = res + return ec.marshalOString2ᚖstring(ctx, field.Selections, res) +} + +func (ec *executionContext) fieldContext_Condition_message(_ context.Context, field graphql.CollectedField) (fc *graphql.FieldContext, err error) { + fc = &graphql.FieldContext{ + Object: "Condition", + Field: field, + IsMethod: false, + IsResolver: false, + Child: func(ctx context.Context, field graphql.CollectedField) (*graphql.FieldContext, error) { + return nil, errors.New("field of type String does not have child fields") + }, + } + return fc, nil +} + +func (ec *executionContext) _Destination_id(ctx context.Context, field graphql.CollectedField, obj *model.Destination) (ret graphql.Marshaler) { + fc, err := ec.fieldContext_Destination_id(ctx, field) + if err != nil { + return graphql.Null + } + ctx = graphql.WithFieldContext(ctx, fc) + defer func() { + if r := recover(); r != nil { + ec.Error(ctx, ec.Recover(ctx, r)) + ret = graphql.Null + } + }() + resTmp, err := ec.ResolverMiddleware(ctx, func(rctx context.Context) (interface{}, error) { + ctx = rctx // use context from middleware stack in children + return obj.Id, nil + }) + if err != nil { + ec.Error(ctx, err) + return graphql.Null + } + if resTmp == nil { + if !graphql.HasFieldError(ctx, fc) { + ec.Errorf(ctx, "must not be null") + } + return graphql.Null + } + res := resTmp.(string) + fc.Result = res + return ec.marshalNID2string(ctx, field.Selections, res) +} + +func (ec *executionContext) fieldContext_Destination_id(_ context.Context, field graphql.CollectedField) (fc *graphql.FieldContext, err error) { + fc = &graphql.FieldContext{ + Object: "Destination", + Field: field, + IsMethod: false, + IsResolver: false, + Child: func(ctx context.Context, field graphql.CollectedField) (*graphql.FieldContext, error) { + return nil, errors.New("field of type ID does not have child fields") + }, + } + return fc, nil +} + +func (ec *executionContext) _Destination_name(ctx context.Context, field graphql.CollectedField, obj *model.Destination) (ret graphql.Marshaler) { + fc, err := ec.fieldContext_Destination_name(ctx, field) + if err != nil { + return graphql.Null + } + ctx = graphql.WithFieldContext(ctx, fc) + defer func() { + if r := recover(); r != nil { + ec.Error(ctx, ec.Recover(ctx, r)) + ret = graphql.Null + } + }() + resTmp, err := ec.ResolverMiddleware(ctx, func(rctx context.Context) (interface{}, error) { + ctx = rctx // use context from middleware stack in children + return obj.Name, nil + }) + if err != nil { + ec.Error(ctx, err) + return graphql.Null + } + if resTmp == nil { + if !graphql.HasFieldError(ctx, fc) { + ec.Errorf(ctx, "must not be null") + } + return graphql.Null + } + res := resTmp.(string) + fc.Result = res + return ec.marshalNString2string(ctx, field.Selections, res) +} + +func (ec *executionContext) fieldContext_Destination_name(_ context.Context, field graphql.CollectedField) (fc *graphql.FieldContext, err error) { + fc = &graphql.FieldContext{ + Object: "Destination", + Field: field, + IsMethod: false, + IsResolver: false, + Child: func(ctx context.Context, field graphql.CollectedField) (*graphql.FieldContext, error) { + return nil, errors.New("field of type String does not have child fields") + }, + } + return fc, nil +} + +func (ec *executionContext) _Destination_type(ctx context.Context, field graphql.CollectedField, obj *model.Destination) (ret graphql.Marshaler) { + fc, err := ec.fieldContext_Destination_type(ctx, field) + if err != nil { + return graphql.Null + } + ctx = graphql.WithFieldContext(ctx, fc) + defer func() { + if r := recover(); r != nil { + ec.Error(ctx, ec.Recover(ctx, r)) + ret = graphql.Null + } + }() + resTmp, err := ec.ResolverMiddleware(ctx, func(rctx context.Context) (interface{}, error) { + ctx = rctx // use context from middleware stack in children + return ec.resolvers.Destination().Type(rctx, obj) + }) + if err != nil { + ec.Error(ctx, err) + return graphql.Null + } + if resTmp == nil { + if !graphql.HasFieldError(ctx, fc) { + ec.Errorf(ctx, "must not be null") + } + return graphql.Null + } + res := resTmp.(string) + fc.Result = res + return ec.marshalNString2string(ctx, field.Selections, res) +} + +func (ec *executionContext) fieldContext_Destination_type(_ context.Context, field graphql.CollectedField) (fc *graphql.FieldContext, err error) { + fc = &graphql.FieldContext{ + Object: "Destination", + Field: field, + IsMethod: true, + IsResolver: true, + Child: func(ctx context.Context, field graphql.CollectedField) (*graphql.FieldContext, error) { + return nil, errors.New("field of type String does not have child fields") + }, + } + return fc, nil +} + +func (ec *executionContext) _Destination_exportedSignals(ctx context.Context, field graphql.CollectedField, obj *model.Destination) (ret graphql.Marshaler) { + fc, err := ec.fieldContext_Destination_exportedSignals(ctx, field) + if err != nil { + return graphql.Null + } + ctx = graphql.WithFieldContext(ctx, fc) + defer func() { + if r := recover(); r != nil { + ec.Error(ctx, ec.Recover(ctx, r)) + ret = graphql.Null + } + }() + resTmp, err := ec.ResolverMiddleware(ctx, func(rctx context.Context) (interface{}, error) { + ctx = rctx // use context from middleware stack in children + return obj.ExportedSignals, nil + }) + if err != nil { + ec.Error(ctx, err) + return graphql.Null + } + if resTmp == nil { + if !graphql.HasFieldError(ctx, fc) { + ec.Errorf(ctx, "must not be null") + } + return graphql.Null + } + res := resTmp.(model.ExportedSignals) + fc.Result = res + return ec.marshalNExportedSignals2githubᚗcomᚋodigosᚑioᚋodigosᚋfrontendᚋgraphᚋmodelᚐExportedSignals(ctx, field.Selections, res) +} + +func (ec *executionContext) fieldContext_Destination_exportedSignals(_ context.Context, field graphql.CollectedField) (fc *graphql.FieldContext, err error) { + fc = &graphql.FieldContext{ + Object: "Destination", + Field: field, + IsMethod: false, + IsResolver: false, + Child: func(ctx context.Context, field graphql.CollectedField) (*graphql.FieldContext, error) { + switch field.Name { + case "traces": + return ec.fieldContext_ExportedSignals_traces(ctx, field) + case "metrics": + return ec.fieldContext_ExportedSignals_metrics(ctx, field) + case "logs": + return ec.fieldContext_ExportedSignals_logs(ctx, field) + } + return nil, fmt.Errorf("no field named %q was found under type ExportedSignals", field.Name) + }, + } + return fc, nil +} + +func (ec *executionContext) _Destination_fields(ctx context.Context, field graphql.CollectedField, obj *model.Destination) (ret graphql.Marshaler) { + fc, err := ec.fieldContext_Destination_fields(ctx, field) + if err != nil { + return graphql.Null + } + ctx = graphql.WithFieldContext(ctx, fc) + defer func() { + if r := recover(); r != nil { + ec.Error(ctx, ec.Recover(ctx, r)) + ret = graphql.Null + } + }() + resTmp, err := ec.ResolverMiddleware(ctx, func(rctx context.Context) (interface{}, error) { + ctx = rctx // use context from middleware stack in children + return obj.Fields, nil + }) + if err != nil { + ec.Error(ctx, err) + return graphql.Null + } + if resTmp == nil { + if !graphql.HasFieldError(ctx, fc) { + ec.Errorf(ctx, "must not be null") + } + return graphql.Null + } + res := resTmp.(string) + fc.Result = res + return ec.marshalNString2string(ctx, field.Selections, res) +} + +func (ec *executionContext) fieldContext_Destination_fields(_ context.Context, field graphql.CollectedField) (fc *graphql.FieldContext, err error) { + fc = &graphql.FieldContext{ + Object: "Destination", + Field: field, + IsMethod: false, + IsResolver: false, + Child: func(ctx context.Context, field graphql.CollectedField) (*graphql.FieldContext, error) { + return nil, errors.New("field of type String does not have child fields") + }, + } + return fc, nil +} + +func (ec *executionContext) _Destination_destinationType(ctx context.Context, field graphql.CollectedField, obj *model.Destination) (ret graphql.Marshaler) { + fc, err := ec.fieldContext_Destination_destinationType(ctx, field) + if err != nil { + return graphql.Null + } + ctx = graphql.WithFieldContext(ctx, fc) + defer func() { + if r := recover(); r != nil { + ec.Error(ctx, ec.Recover(ctx, r)) + ret = graphql.Null + } + }() + resTmp, err := ec.ResolverMiddleware(ctx, func(rctx context.Context) (interface{}, error) { + ctx = rctx // use context from middleware stack in children + return obj.DestinationType, nil + }) + if err != nil { + ec.Error(ctx, err) + return graphql.Null + } + if resTmp == nil { + if !graphql.HasFieldError(ctx, fc) { + ec.Errorf(ctx, "must not be null") + } + return graphql.Null + } + res := resTmp.(model.DestinationTypesCategoryItem) + fc.Result = res + return ec.marshalNDestinationTypesCategoryItem2githubᚗcomᚋodigosᚑioᚋodigosᚋfrontendᚋgraphᚋmodelᚐDestinationTypesCategoryItem(ctx, field.Selections, res) +} + +func (ec *executionContext) fieldContext_Destination_destinationType(_ context.Context, field graphql.CollectedField) (fc *graphql.FieldContext, err error) { + fc = &graphql.FieldContext{ + Object: "Destination", + Field: field, + IsMethod: false, + IsResolver: false, + Child: func(ctx context.Context, field graphql.CollectedField) (*graphql.FieldContext, error) { + switch field.Name { + case "type": + return ec.fieldContext_DestinationTypesCategoryItem_type(ctx, field) + case "displayName": + return ec.fieldContext_DestinationTypesCategoryItem_displayName(ctx, field) + case "imageUrl": + return ec.fieldContext_DestinationTypesCategoryItem_imageUrl(ctx, field) + case "supportedSignals": + return ec.fieldContext_DestinationTypesCategoryItem_supportedSignals(ctx, field) + case "testConnectionSupported": + return ec.fieldContext_DestinationTypesCategoryItem_testConnectionSupported(ctx, field) + } + return nil, fmt.Errorf("no field named %q was found under type DestinationTypesCategoryItem", field.Name) + }, + } + return fc, nil +} + +func (ec *executionContext) _Destination_conditions(ctx context.Context, field graphql.CollectedField, obj *model.Destination) (ret graphql.Marshaler) { + fc, err := ec.fieldContext_Destination_conditions(ctx, field) + if err != nil { + return graphql.Null + } + ctx = graphql.WithFieldContext(ctx, fc) + defer func() { + if r := recover(); r != nil { + ec.Error(ctx, ec.Recover(ctx, r)) + ret = graphql.Null + } + }() + resTmp, err := ec.ResolverMiddleware(ctx, func(rctx context.Context) (interface{}, error) { + ctx = rctx // use context from middleware stack in children + return ec.resolvers.Destination().Conditions(rctx, obj) + }) + if err != nil { + ec.Error(ctx, err) + return graphql.Null + } + if resTmp == nil { + return graphql.Null + } + res := resTmp.([]*model.Condition) + fc.Result = res + return ec.marshalOCondition2ᚕᚖgithubᚗcomᚋodigosᚑioᚋodigosᚋfrontendᚋgraphᚋmodelᚐConditionᚄ(ctx, field.Selections, res) +} + +func (ec *executionContext) fieldContext_Destination_conditions(_ context.Context, field graphql.CollectedField) (fc *graphql.FieldContext, err error) { + fc = &graphql.FieldContext{ + Object: "Destination", + Field: field, + IsMethod: true, + IsResolver: true, + Child: func(ctx context.Context, field graphql.CollectedField) (*graphql.FieldContext, error) { + switch field.Name { + case "type": + return ec.fieldContext_Condition_type(ctx, field) + case "status": + return ec.fieldContext_Condition_status(ctx, field) + case "lastTransitionTime": + return ec.fieldContext_Condition_lastTransitionTime(ctx, field) + case "reason": + return ec.fieldContext_Condition_reason(ctx, field) + case "message": + return ec.fieldContext_Condition_message(ctx, field) + } + return nil, fmt.Errorf("no field named %q was found under type Condition", field.Name) + }, + } + return fc, nil +} + +func (ec *executionContext) _DestinationDetails_type(ctx context.Context, field graphql.CollectedField, obj *model.DestinationDetails) (ret graphql.Marshaler) { + fc, err := ec.fieldContext_DestinationDetails_type(ctx, field) + if err != nil { + return graphql.Null + } + ctx = graphql.WithFieldContext(ctx, fc) + defer func() { + if r := recover(); r != nil { + ec.Error(ctx, ec.Recover(ctx, r)) + ret = graphql.Null + } + }() + resTmp, err := ec.ResolverMiddleware(ctx, func(rctx context.Context) (interface{}, error) { + ctx = rctx // use context from middleware stack in children + return obj.Type, nil + }) + if err != nil { + ec.Error(ctx, err) + return graphql.Null + } + if resTmp == nil { + if !graphql.HasFieldError(ctx, fc) { + ec.Errorf(ctx, "must not be null") + } + return graphql.Null + } + res := resTmp.(string) + fc.Result = res + return ec.marshalNString2string(ctx, field.Selections, res) +} + +func (ec *executionContext) fieldContext_DestinationDetails_type(_ context.Context, field graphql.CollectedField) (fc *graphql.FieldContext, err error) { + fc = &graphql.FieldContext{ + Object: "DestinationDetails", + Field: field, + IsMethod: false, + IsResolver: false, + Child: func(ctx context.Context, field graphql.CollectedField) (*graphql.FieldContext, error) { + return nil, errors.New("field of type String does not have child fields") + }, + } + return fc, nil +} + +func (ec *executionContext) _DestinationDetails_urlString(ctx context.Context, field graphql.CollectedField, obj *model.DestinationDetails) (ret graphql.Marshaler) { + fc, err := ec.fieldContext_DestinationDetails_urlString(ctx, field) + if err != nil { + return graphql.Null + } + ctx = graphql.WithFieldContext(ctx, fc) + defer func() { + if r := recover(); r != nil { + ec.Error(ctx, ec.Recover(ctx, r)) + ret = graphql.Null + } + }() + resTmp, err := ec.ResolverMiddleware(ctx, func(rctx context.Context) (interface{}, error) { + ctx = rctx // use context from middleware stack in children + return obj.URLString, nil + }) + if err != nil { + ec.Error(ctx, err) + return graphql.Null + } + if resTmp == nil { + if !graphql.HasFieldError(ctx, fc) { + ec.Errorf(ctx, "must not be null") + } + return graphql.Null + } + res := resTmp.(string) + fc.Result = res + return ec.marshalNString2string(ctx, field.Selections, res) +} + +func (ec *executionContext) fieldContext_DestinationDetails_urlString(_ context.Context, field graphql.CollectedField) (fc *graphql.FieldContext, err error) { + fc = &graphql.FieldContext{ + Object: "DestinationDetails", + Field: field, + IsMethod: false, + IsResolver: false, + Child: func(ctx context.Context, field graphql.CollectedField) (*graphql.FieldContext, error) { + return nil, errors.New("field of type String does not have child fields") + }, + } + return fc, nil +} + +func (ec *executionContext) _DestinationDetails_fields(ctx context.Context, field graphql.CollectedField, obj *model.DestinationDetails) (ret graphql.Marshaler) { + fc, err := ec.fieldContext_DestinationDetails_fields(ctx, field) + if err != nil { + return graphql.Null + } + ctx = graphql.WithFieldContext(ctx, fc) + defer func() { + if r := recover(); r != nil { + ec.Error(ctx, ec.Recover(ctx, r)) + ret = graphql.Null + } + }() + resTmp, err := ec.ResolverMiddleware(ctx, func(rctx context.Context) (interface{}, error) { + ctx = rctx // use context from middleware stack in children + return obj.Fields, nil + }) + if err != nil { + ec.Error(ctx, err) + return graphql.Null + } + if resTmp == nil { + if !graphql.HasFieldError(ctx, fc) { + ec.Errorf(ctx, "must not be null") + } + return graphql.Null + } + res := resTmp.(string) + fc.Result = res + return ec.marshalNString2string(ctx, field.Selections, res) +} + +func (ec *executionContext) fieldContext_DestinationDetails_fields(_ context.Context, field graphql.CollectedField) (fc *graphql.FieldContext, err error) { + fc = &graphql.FieldContext{ + Object: "DestinationDetails", + Field: field, + IsMethod: false, + IsResolver: false, + Child: func(ctx context.Context, field graphql.CollectedField) (*graphql.FieldContext, error) { + return nil, errors.New("field of type String does not have child fields") + }, + } + return fc, nil +} + +func (ec *executionContext) _DestinationTypesCategoryItem_type(ctx context.Context, field graphql.CollectedField, obj *model.DestinationTypesCategoryItem) (ret graphql.Marshaler) { + fc, err := ec.fieldContext_DestinationTypesCategoryItem_type(ctx, field) + if err != nil { + return graphql.Null + } + ctx = graphql.WithFieldContext(ctx, fc) + defer func() { + if r := recover(); r != nil { + ec.Error(ctx, ec.Recover(ctx, r)) + ret = graphql.Null + } + }() + resTmp, err := ec.ResolverMiddleware(ctx, func(rctx context.Context) (interface{}, error) { + ctx = rctx // use context from middleware stack in children + return obj.Type, nil + }) + if err != nil { + ec.Error(ctx, err) + return graphql.Null + } + if resTmp == nil { + if !graphql.HasFieldError(ctx, fc) { + ec.Errorf(ctx, "must not be null") + } + return graphql.Null + } + res := resTmp.(string) + fc.Result = res + return ec.marshalNString2string(ctx, field.Selections, res) +} + +func (ec *executionContext) fieldContext_DestinationTypesCategoryItem_type(_ context.Context, field graphql.CollectedField) (fc *graphql.FieldContext, err error) { + fc = &graphql.FieldContext{ + Object: "DestinationTypesCategoryItem", + Field: field, + IsMethod: false, + IsResolver: false, + Child: func(ctx context.Context, field graphql.CollectedField) (*graphql.FieldContext, error) { + return nil, errors.New("field of type String does not have child fields") + }, + } + return fc, nil +} + +func (ec *executionContext) _DestinationTypesCategoryItem_displayName(ctx context.Context, field graphql.CollectedField, obj *model.DestinationTypesCategoryItem) (ret graphql.Marshaler) { + fc, err := ec.fieldContext_DestinationTypesCategoryItem_displayName(ctx, field) + if err != nil { + return graphql.Null + } + ctx = graphql.WithFieldContext(ctx, fc) + defer func() { + if r := recover(); r != nil { + ec.Error(ctx, ec.Recover(ctx, r)) + ret = graphql.Null + } + }() + resTmp, err := ec.ResolverMiddleware(ctx, func(rctx context.Context) (interface{}, error) { + ctx = rctx // use context from middleware stack in children + return obj.DisplayName, nil + }) + if err != nil { + ec.Error(ctx, err) + return graphql.Null + } + if resTmp == nil { + if !graphql.HasFieldError(ctx, fc) { + ec.Errorf(ctx, "must not be null") + } + return graphql.Null + } + res := resTmp.(string) + fc.Result = res + return ec.marshalNString2string(ctx, field.Selections, res) +} + +func (ec *executionContext) fieldContext_DestinationTypesCategoryItem_displayName(_ context.Context, field graphql.CollectedField) (fc *graphql.FieldContext, err error) { + fc = &graphql.FieldContext{ + Object: "DestinationTypesCategoryItem", + Field: field, + IsMethod: false, + IsResolver: false, + Child: func(ctx context.Context, field graphql.CollectedField) (*graphql.FieldContext, error) { + return nil, errors.New("field of type String does not have child fields") + }, + } + return fc, nil +} + +func (ec *executionContext) _DestinationTypesCategoryItem_imageUrl(ctx context.Context, field graphql.CollectedField, obj *model.DestinationTypesCategoryItem) (ret graphql.Marshaler) { + fc, err := ec.fieldContext_DestinationTypesCategoryItem_imageUrl(ctx, field) + if err != nil { + return graphql.Null + } + ctx = graphql.WithFieldContext(ctx, fc) + defer func() { + if r := recover(); r != nil { + ec.Error(ctx, ec.Recover(ctx, r)) + ret = graphql.Null + } + }() + resTmp, err := ec.ResolverMiddleware(ctx, func(rctx context.Context) (interface{}, error) { + ctx = rctx // use context from middleware stack in children + return obj.ImageUrl, nil + }) + if err != nil { + ec.Error(ctx, err) + return graphql.Null + } + if resTmp == nil { + if !graphql.HasFieldError(ctx, fc) { + ec.Errorf(ctx, "must not be null") + } + return graphql.Null + } + res := resTmp.(string) + fc.Result = res + return ec.marshalNString2string(ctx, field.Selections, res) +} + +func (ec *executionContext) fieldContext_DestinationTypesCategoryItem_imageUrl(_ context.Context, field graphql.CollectedField) (fc *graphql.FieldContext, err error) { + fc = &graphql.FieldContext{ + Object: "DestinationTypesCategoryItem", + Field: field, + IsMethod: false, + IsResolver: false, + Child: func(ctx context.Context, field graphql.CollectedField) (*graphql.FieldContext, error) { + return nil, errors.New("field of type String does not have child fields") + }, + } + return fc, nil +} + +func (ec *executionContext) _DestinationTypesCategoryItem_supportedSignals(ctx context.Context, field graphql.CollectedField, obj *model.DestinationTypesCategoryItem) (ret graphql.Marshaler) { + fc, err := ec.fieldContext_DestinationTypesCategoryItem_supportedSignals(ctx, field) + if err != nil { + return graphql.Null + } + ctx = graphql.WithFieldContext(ctx, fc) + defer func() { + if r := recover(); r != nil { + ec.Error(ctx, ec.Recover(ctx, r)) + ret = graphql.Null + } + }() + resTmp, err := ec.ResolverMiddleware(ctx, func(rctx context.Context) (interface{}, error) { + ctx = rctx // use context from middleware stack in children + return obj.SupportedSignals, nil + }) + if err != nil { + ec.Error(ctx, err) + return graphql.Null + } + if resTmp == nil { + if !graphql.HasFieldError(ctx, fc) { + ec.Errorf(ctx, "must not be null") + } + return graphql.Null + } + res := resTmp.(model.SupportedSignals) + fc.Result = res + return ec.marshalNSupportedSignals2githubᚗcomᚋodigosᚑioᚋodigosᚋfrontendᚋgraphᚋmodelᚐSupportedSignals(ctx, field.Selections, res) +} + +func (ec *executionContext) fieldContext_DestinationTypesCategoryItem_supportedSignals(_ context.Context, field graphql.CollectedField) (fc *graphql.FieldContext, err error) { + fc = &graphql.FieldContext{ + Object: "DestinationTypesCategoryItem", + Field: field, + IsMethod: false, + IsResolver: false, + Child: func(ctx context.Context, field graphql.CollectedField) (*graphql.FieldContext, error) { + switch field.Name { + case "traces": + return ec.fieldContext_SupportedSignals_traces(ctx, field) + case "metrics": + return ec.fieldContext_SupportedSignals_metrics(ctx, field) + case "logs": + return ec.fieldContext_SupportedSignals_logs(ctx, field) + } + return nil, fmt.Errorf("no field named %q was found under type SupportedSignals", field.Name) + }, + } + return fc, nil +} + +func (ec *executionContext) _DestinationTypesCategoryItem_testConnectionSupported(ctx context.Context, field graphql.CollectedField, obj *model.DestinationTypesCategoryItem) (ret graphql.Marshaler) { + fc, err := ec.fieldContext_DestinationTypesCategoryItem_testConnectionSupported(ctx, field) + if err != nil { + return graphql.Null + } + ctx = graphql.WithFieldContext(ctx, fc) + defer func() { + if r := recover(); r != nil { + ec.Error(ctx, ec.Recover(ctx, r)) + ret = graphql.Null + } + }() + resTmp, err := ec.ResolverMiddleware(ctx, func(rctx context.Context) (interface{}, error) { + ctx = rctx // use context from middleware stack in children + return obj.TestConnectionSupported, nil + }) + if err != nil { + ec.Error(ctx, err) + return graphql.Null + } + if resTmp == nil { + if !graphql.HasFieldError(ctx, fc) { + ec.Errorf(ctx, "must not be null") + } + return graphql.Null + } + res := resTmp.(bool) + fc.Result = res + return ec.marshalNBoolean2bool(ctx, field.Selections, res) +} + +func (ec *executionContext) fieldContext_DestinationTypesCategoryItem_testConnectionSupported(_ context.Context, field graphql.CollectedField) (fc *graphql.FieldContext, err error) { + fc = &graphql.FieldContext{ + Object: "DestinationTypesCategoryItem", + Field: field, + IsMethod: false, + IsResolver: false, + Child: func(ctx context.Context, field graphql.CollectedField) (*graphql.FieldContext, error) { + return nil, errors.New("field of type Boolean does not have child fields") + }, + } + return fc, nil +} + +func (ec *executionContext) _DestinationsCategory_name(ctx context.Context, field graphql.CollectedField, obj *model.DestinationsCategory) (ret graphql.Marshaler) { + fc, err := ec.fieldContext_DestinationsCategory_name(ctx, field) + if err != nil { + return graphql.Null + } + ctx = graphql.WithFieldContext(ctx, fc) + defer func() { + if r := recover(); r != nil { + ec.Error(ctx, ec.Recover(ctx, r)) + ret = graphql.Null + } + }() + resTmp, err := ec.ResolverMiddleware(ctx, func(rctx context.Context) (interface{}, error) { + ctx = rctx // use context from middleware stack in children + return obj.Name, nil + }) + if err != nil { + ec.Error(ctx, err) + return graphql.Null + } + if resTmp == nil { + if !graphql.HasFieldError(ctx, fc) { + ec.Errorf(ctx, "must not be null") + } + return graphql.Null + } + res := resTmp.(string) + fc.Result = res + return ec.marshalNString2string(ctx, field.Selections, res) +} + +func (ec *executionContext) fieldContext_DestinationsCategory_name(_ context.Context, field graphql.CollectedField) (fc *graphql.FieldContext, err error) { + fc = &graphql.FieldContext{ + Object: "DestinationsCategory", + Field: field, + IsMethod: false, + IsResolver: false, + Child: func(ctx context.Context, field graphql.CollectedField) (*graphql.FieldContext, error) { + return nil, errors.New("field of type String does not have child fields") + }, + } + return fc, nil +} + +func (ec *executionContext) _DestinationsCategory_items(ctx context.Context, field graphql.CollectedField, obj *model.DestinationsCategory) (ret graphql.Marshaler) { + fc, err := ec.fieldContext_DestinationsCategory_items(ctx, field) + if err != nil { + return graphql.Null + } + ctx = graphql.WithFieldContext(ctx, fc) + defer func() { + if r := recover(); r != nil { + ec.Error(ctx, ec.Recover(ctx, r)) + ret = graphql.Null + } + }() + resTmp, err := ec.ResolverMiddleware(ctx, func(rctx context.Context) (interface{}, error) { + ctx = rctx // use context from middleware stack in children + return obj.Items, nil + }) + if err != nil { + ec.Error(ctx, err) + return graphql.Null + } + if resTmp == nil { + if !graphql.HasFieldError(ctx, fc) { + ec.Errorf(ctx, "must not be null") + } + return graphql.Null + } + res := resTmp.([]model.DestinationTypesCategoryItem) + fc.Result = res + return ec.marshalNDestinationTypesCategoryItem2ᚕgithubᚗcomᚋodigosᚑioᚋodigosᚋfrontendᚋgraphᚋmodelᚐDestinationTypesCategoryItemᚄ(ctx, field.Selections, res) +} + +func (ec *executionContext) fieldContext_DestinationsCategory_items(_ context.Context, field graphql.CollectedField) (fc *graphql.FieldContext, err error) { + fc = &graphql.FieldContext{ + Object: "DestinationsCategory", + Field: field, + IsMethod: false, + IsResolver: false, + Child: func(ctx context.Context, field graphql.CollectedField) (*graphql.FieldContext, error) { + switch field.Name { + case "type": + return ec.fieldContext_DestinationTypesCategoryItem_type(ctx, field) + case "displayName": + return ec.fieldContext_DestinationTypesCategoryItem_displayName(ctx, field) + case "imageUrl": + return ec.fieldContext_DestinationTypesCategoryItem_imageUrl(ctx, field) + case "supportedSignals": + return ec.fieldContext_DestinationTypesCategoryItem_supportedSignals(ctx, field) + case "testConnectionSupported": + return ec.fieldContext_DestinationTypesCategoryItem_testConnectionSupported(ctx, field) + } + return nil, fmt.Errorf("no field named %q was found under type DestinationTypesCategoryItem", field.Name) + }, + } + return fc, nil +} + +func (ec *executionContext) _ExportedSignals_traces(ctx context.Context, field graphql.CollectedField, obj *model.ExportedSignals) (ret graphql.Marshaler) { + fc, err := ec.fieldContext_ExportedSignals_traces(ctx, field) + if err != nil { + return graphql.Null + } + ctx = graphql.WithFieldContext(ctx, fc) + defer func() { + if r := recover(); r != nil { + ec.Error(ctx, ec.Recover(ctx, r)) + ret = graphql.Null + } + }() + resTmp, err := ec.ResolverMiddleware(ctx, func(rctx context.Context) (interface{}, error) { + ctx = rctx // use context from middleware stack in children + return obj.Traces, nil + }) + if err != nil { + ec.Error(ctx, err) + return graphql.Null + } + if resTmp == nil { + if !graphql.HasFieldError(ctx, fc) { + ec.Errorf(ctx, "must not be null") + } + return graphql.Null + } + res := resTmp.(bool) + fc.Result = res + return ec.marshalNBoolean2bool(ctx, field.Selections, res) +} + +func (ec *executionContext) fieldContext_ExportedSignals_traces(_ context.Context, field graphql.CollectedField) (fc *graphql.FieldContext, err error) { + fc = &graphql.FieldContext{ + Object: "ExportedSignals", + Field: field, + IsMethod: false, + IsResolver: false, + Child: func(ctx context.Context, field graphql.CollectedField) (*graphql.FieldContext, error) { + return nil, errors.New("field of type Boolean does not have child fields") + }, + } + return fc, nil +} + +func (ec *executionContext) _ExportedSignals_metrics(ctx context.Context, field graphql.CollectedField, obj *model.ExportedSignals) (ret graphql.Marshaler) { + fc, err := ec.fieldContext_ExportedSignals_metrics(ctx, field) + if err != nil { + return graphql.Null + } + ctx = graphql.WithFieldContext(ctx, fc) + defer func() { + if r := recover(); r != nil { + ec.Error(ctx, ec.Recover(ctx, r)) + ret = graphql.Null + } + }() + resTmp, err := ec.ResolverMiddleware(ctx, func(rctx context.Context) (interface{}, error) { + ctx = rctx // use context from middleware stack in children + return obj.Metrics, nil + }) + if err != nil { + ec.Error(ctx, err) + return graphql.Null + } + if resTmp == nil { + if !graphql.HasFieldError(ctx, fc) { + ec.Errorf(ctx, "must not be null") + } + return graphql.Null + } + res := resTmp.(bool) + fc.Result = res + return ec.marshalNBoolean2bool(ctx, field.Selections, res) +} + +func (ec *executionContext) fieldContext_ExportedSignals_metrics(_ context.Context, field graphql.CollectedField) (fc *graphql.FieldContext, err error) { + fc = &graphql.FieldContext{ + Object: "ExportedSignals", + Field: field, + IsMethod: false, + IsResolver: false, + Child: func(ctx context.Context, field graphql.CollectedField) (*graphql.FieldContext, error) { + return nil, errors.New("field of type Boolean does not have child fields") + }, + } + return fc, nil +} + +func (ec *executionContext) _ExportedSignals_logs(ctx context.Context, field graphql.CollectedField, obj *model.ExportedSignals) (ret graphql.Marshaler) { + fc, err := ec.fieldContext_ExportedSignals_logs(ctx, field) + if err != nil { + return graphql.Null + } + ctx = graphql.WithFieldContext(ctx, fc) + defer func() { + if r := recover(); r != nil { + ec.Error(ctx, ec.Recover(ctx, r)) + ret = graphql.Null + } + }() + resTmp, err := ec.ResolverMiddleware(ctx, func(rctx context.Context) (interface{}, error) { + ctx = rctx // use context from middleware stack in children + return obj.Logs, nil + }) + if err != nil { + ec.Error(ctx, err) + return graphql.Null + } + if resTmp == nil { + if !graphql.HasFieldError(ctx, fc) { + ec.Errorf(ctx, "must not be null") + } + return graphql.Null + } + res := resTmp.(bool) + fc.Result = res + return ec.marshalNBoolean2bool(ctx, field.Selections, res) +} + +func (ec *executionContext) fieldContext_ExportedSignals_logs(_ context.Context, field graphql.CollectedField) (fc *graphql.FieldContext, err error) { + fc = &graphql.FieldContext{ + Object: "ExportedSignals", + Field: field, + IsMethod: false, + IsResolver: false, + Child: func(ctx context.Context, field graphql.CollectedField) (*graphql.FieldContext, error) { + return nil, errors.New("field of type Boolean does not have child fields") + }, + } + return fc, nil +} + +func (ec *executionContext) _Field_name(ctx context.Context, field graphql.CollectedField, obj *model.Field) (ret graphql.Marshaler) { + fc, err := ec.fieldContext_Field_name(ctx, field) + if err != nil { + return graphql.Null + } + ctx = graphql.WithFieldContext(ctx, fc) + defer func() { + if r := recover(); r != nil { + ec.Error(ctx, ec.Recover(ctx, r)) + ret = graphql.Null + } + }() + resTmp, err := ec.ResolverMiddleware(ctx, func(rctx context.Context) (interface{}, error) { + ctx = rctx // use context from middleware stack in children + return obj.Name, nil + }) + if err != nil { + ec.Error(ctx, err) + return graphql.Null + } + if resTmp == nil { + if !graphql.HasFieldError(ctx, fc) { + ec.Errorf(ctx, "must not be null") + } + return graphql.Null + } + res := resTmp.(string) + fc.Result = res + return ec.marshalNString2string(ctx, field.Selections, res) +} + +func (ec *executionContext) fieldContext_Field_name(_ context.Context, field graphql.CollectedField) (fc *graphql.FieldContext, err error) { + fc = &graphql.FieldContext{ + Object: "Field", + Field: field, + IsMethod: false, + IsResolver: false, + Child: func(ctx context.Context, field graphql.CollectedField) (*graphql.FieldContext, error) { + return nil, errors.New("field of type String does not have child fields") + }, + } + return fc, nil +} + +func (ec *executionContext) _Field_displayName(ctx context.Context, field graphql.CollectedField, obj *model.Field) (ret graphql.Marshaler) { + fc, err := ec.fieldContext_Field_displayName(ctx, field) + if err != nil { + return graphql.Null + } + ctx = graphql.WithFieldContext(ctx, fc) + defer func() { + if r := recover(); r != nil { + ec.Error(ctx, ec.Recover(ctx, r)) + ret = graphql.Null + } + }() + resTmp, err := ec.ResolverMiddleware(ctx, func(rctx context.Context) (interface{}, error) { + ctx = rctx // use context from middleware stack in children + return obj.DisplayName, nil + }) + if err != nil { + ec.Error(ctx, err) + return graphql.Null + } + if resTmp == nil { + if !graphql.HasFieldError(ctx, fc) { + ec.Errorf(ctx, "must not be null") + } + return graphql.Null + } + res := resTmp.(string) + fc.Result = res + return ec.marshalNString2string(ctx, field.Selections, res) +} + +func (ec *executionContext) fieldContext_Field_displayName(_ context.Context, field graphql.CollectedField) (fc *graphql.FieldContext, err error) { + fc = &graphql.FieldContext{ + Object: "Field", + Field: field, + IsMethod: false, + IsResolver: false, + Child: func(ctx context.Context, field graphql.CollectedField) (*graphql.FieldContext, error) { + return nil, errors.New("field of type String does not have child fields") + }, + } + return fc, nil +} + +func (ec *executionContext) _Field_componentType(ctx context.Context, field graphql.CollectedField, obj *model.Field) (ret graphql.Marshaler) { + fc, err := ec.fieldContext_Field_componentType(ctx, field) + if err != nil { + return graphql.Null + } + ctx = graphql.WithFieldContext(ctx, fc) + defer func() { + if r := recover(); r != nil { + ec.Error(ctx, ec.Recover(ctx, r)) + ret = graphql.Null + } + }() + resTmp, err := ec.ResolverMiddleware(ctx, func(rctx context.Context) (interface{}, error) { + ctx = rctx // use context from middleware stack in children + return obj.ComponentType, nil + }) + if err != nil { + ec.Error(ctx, err) + return graphql.Null + } + if resTmp == nil { + if !graphql.HasFieldError(ctx, fc) { + ec.Errorf(ctx, "must not be null") + } + return graphql.Null + } + res := resTmp.(string) + fc.Result = res + return ec.marshalNString2string(ctx, field.Selections, res) +} + +func (ec *executionContext) fieldContext_Field_componentType(_ context.Context, field graphql.CollectedField) (fc *graphql.FieldContext, err error) { + fc = &graphql.FieldContext{ + Object: "Field", + Field: field, + IsMethod: false, + IsResolver: false, + Child: func(ctx context.Context, field graphql.CollectedField) (*graphql.FieldContext, error) { + return nil, errors.New("field of type String does not have child fields") + }, + } + return fc, nil +} + +func (ec *executionContext) _Field_componentProperties(ctx context.Context, field graphql.CollectedField, obj *model.Field) (ret graphql.Marshaler) { + fc, err := ec.fieldContext_Field_componentProperties(ctx, field) + if err != nil { + return graphql.Null + } + ctx = graphql.WithFieldContext(ctx, fc) + defer func() { + if r := recover(); r != nil { + ec.Error(ctx, ec.Recover(ctx, r)) + ret = graphql.Null + } + }() + resTmp, err := ec.ResolverMiddleware(ctx, func(rctx context.Context) (interface{}, error) { + ctx = rctx // use context from middleware stack in children + return obj.ComponentProperties, nil + }) + if err != nil { + ec.Error(ctx, err) + return graphql.Null + } + if resTmp == nil { + if !graphql.HasFieldError(ctx, fc) { + ec.Errorf(ctx, "must not be null") + } + return graphql.Null + } + res := resTmp.(string) + fc.Result = res + return ec.marshalNString2string(ctx, field.Selections, res) +} + +func (ec *executionContext) fieldContext_Field_componentProperties(_ context.Context, field graphql.CollectedField) (fc *graphql.FieldContext, err error) { + fc = &graphql.FieldContext{ + Object: "Field", + Field: field, + IsMethod: false, + IsResolver: false, + Child: func(ctx context.Context, field graphql.CollectedField) (*graphql.FieldContext, error) { + return nil, errors.New("field of type String does not have child fields") + }, + } + return fc, nil +} + +func (ec *executionContext) _Field_videoUrl(ctx context.Context, field graphql.CollectedField, obj *model.Field) (ret graphql.Marshaler) { + fc, err := ec.fieldContext_Field_videoUrl(ctx, field) + if err != nil { + return graphql.Null + } + ctx = graphql.WithFieldContext(ctx, fc) + defer func() { + if r := recover(); r != nil { + ec.Error(ctx, ec.Recover(ctx, r)) + ret = graphql.Null + } + }() + resTmp, err := ec.ResolverMiddleware(ctx, func(rctx context.Context) (interface{}, error) { + ctx = rctx // use context from middleware stack in children + return obj.VideoURL, nil + }) + if err != nil { + ec.Error(ctx, err) + return graphql.Null + } + if resTmp == nil { + return graphql.Null + } + res := resTmp.(*string) + fc.Result = res + return ec.marshalOString2ᚖstring(ctx, field.Selections, res) +} + +func (ec *executionContext) fieldContext_Field_videoUrl(_ context.Context, field graphql.CollectedField) (fc *graphql.FieldContext, err error) { + fc = &graphql.FieldContext{ + Object: "Field", + Field: field, + IsMethod: false, + IsResolver: false, + Child: func(ctx context.Context, field graphql.CollectedField) (*graphql.FieldContext, error) { + return nil, errors.New("field of type String does not have child fields") + }, + } + return fc, nil +} + +func (ec *executionContext) _Field_thumbnailURL(ctx context.Context, field graphql.CollectedField, obj *model.Field) (ret graphql.Marshaler) { + fc, err := ec.fieldContext_Field_thumbnailURL(ctx, field) + if err != nil { + return graphql.Null + } + ctx = graphql.WithFieldContext(ctx, fc) + defer func() { + if r := recover(); r != nil { + ec.Error(ctx, ec.Recover(ctx, r)) + ret = graphql.Null + } + }() + resTmp, err := ec.ResolverMiddleware(ctx, func(rctx context.Context) (interface{}, error) { + ctx = rctx // use context from middleware stack in children + return obj.ThumbnailURL, nil + }) + if err != nil { + ec.Error(ctx, err) + return graphql.Null + } + if resTmp == nil { + return graphql.Null + } + res := resTmp.(*string) + fc.Result = res + return ec.marshalOString2ᚖstring(ctx, field.Selections, res) +} + +func (ec *executionContext) fieldContext_Field_thumbnailURL(_ context.Context, field graphql.CollectedField) (fc *graphql.FieldContext, err error) { + fc = &graphql.FieldContext{ + Object: "Field", + Field: field, + IsMethod: false, + IsResolver: false, + Child: func(ctx context.Context, field graphql.CollectedField) (*graphql.FieldContext, error) { + return nil, errors.New("field of type String does not have child fields") + }, + } + return fc, nil +} + +func (ec *executionContext) _Field_initialValue(ctx context.Context, field graphql.CollectedField, obj *model.Field) (ret graphql.Marshaler) { + fc, err := ec.fieldContext_Field_initialValue(ctx, field) + if err != nil { + return graphql.Null + } + ctx = graphql.WithFieldContext(ctx, fc) + defer func() { + if r := recover(); r != nil { + ec.Error(ctx, ec.Recover(ctx, r)) + ret = graphql.Null + } + }() + resTmp, err := ec.ResolverMiddleware(ctx, func(rctx context.Context) (interface{}, error) { + ctx = rctx // use context from middleware stack in children + return obj.InitialValue, nil + }) + if err != nil { + ec.Error(ctx, err) + return graphql.Null + } + if resTmp == nil { + return graphql.Null + } + res := resTmp.(*string) + fc.Result = res + return ec.marshalOString2ᚖstring(ctx, field.Selections, res) +} + +func (ec *executionContext) fieldContext_Field_initialValue(_ context.Context, field graphql.CollectedField) (fc *graphql.FieldContext, err error) { + fc = &graphql.FieldContext{ + Object: "Field", + Field: field, + IsMethod: false, + IsResolver: false, + Child: func(ctx context.Context, field graphql.CollectedField) (*graphql.FieldContext, error) { + return nil, errors.New("field of type String does not have child fields") + }, + } + return fc, nil +} + +func (ec *executionContext) _GetConfigResponse_installation(ctx context.Context, field graphql.CollectedField, obj *model.GetConfigResponse) (ret graphql.Marshaler) { + fc, err := ec.fieldContext_GetConfigResponse_installation(ctx, field) + if err != nil { + return graphql.Null + } + ctx = graphql.WithFieldContext(ctx, fc) + defer func() { + if r := recover(); r != nil { + ec.Error(ctx, ec.Recover(ctx, r)) + ret = graphql.Null + } + }() + resTmp, err := ec.ResolverMiddleware(ctx, func(rctx context.Context) (interface{}, error) { + ctx = rctx // use context from middleware stack in children + return obj.Installation, nil + }) + if err != nil { + ec.Error(ctx, err) + return graphql.Null + } + if resTmp == nil { + if !graphql.HasFieldError(ctx, fc) { + ec.Errorf(ctx, "must not be null") + } + return graphql.Null + } + res := resTmp.(model.InstallationStatus) + fc.Result = res + return ec.marshalNInstallationStatus2githubᚗcomᚋodigosᚑioᚋodigosᚋfrontendᚋgraphᚋmodelᚐInstallationStatus(ctx, field.Selections, res) +} + +func (ec *executionContext) fieldContext_GetConfigResponse_installation(_ context.Context, field graphql.CollectedField) (fc *graphql.FieldContext, err error) { + fc = &graphql.FieldContext{ + Object: "GetConfigResponse", + Field: field, + IsMethod: false, + IsResolver: false, + Child: func(ctx context.Context, field graphql.CollectedField) (*graphql.FieldContext, error) { + return nil, errors.New("field of type InstallationStatus does not have child fields") + }, + } + return fc, nil +} + +func (ec *executionContext) _GetDestinationDetailsResponse_fields(ctx context.Context, field graphql.CollectedField, obj *model.GetDestinationDetailsResponse) (ret graphql.Marshaler) { + fc, err := ec.fieldContext_GetDestinationDetailsResponse_fields(ctx, field) + if err != nil { + return graphql.Null + } + ctx = graphql.WithFieldContext(ctx, fc) + defer func() { + if r := recover(); r != nil { + ec.Error(ctx, ec.Recover(ctx, r)) + ret = graphql.Null + } + }() + resTmp, err := ec.ResolverMiddleware(ctx, func(rctx context.Context) (interface{}, error) { + ctx = rctx // use context from middleware stack in children + return obj.Fields, nil + }) + if err != nil { + ec.Error(ctx, err) + return graphql.Null + } + if resTmp == nil { + if !graphql.HasFieldError(ctx, fc) { + ec.Errorf(ctx, "must not be null") + } + return graphql.Null + } + res := resTmp.([]*model.Field) + fc.Result = res + return ec.marshalNField2ᚕᚖgithubᚗcomᚋodigosᚑioᚋodigosᚋfrontendᚋgraphᚋmodelᚐFieldᚄ(ctx, field.Selections, res) +} + +func (ec *executionContext) fieldContext_GetDestinationDetailsResponse_fields(_ context.Context, field graphql.CollectedField) (fc *graphql.FieldContext, err error) { + fc = &graphql.FieldContext{ + Object: "GetDestinationDetailsResponse", + Field: field, + IsMethod: false, + IsResolver: false, + Child: func(ctx context.Context, field graphql.CollectedField) (*graphql.FieldContext, error) { + switch field.Name { + case "name": + return ec.fieldContext_Field_name(ctx, field) + case "displayName": + return ec.fieldContext_Field_displayName(ctx, field) + case "componentType": + return ec.fieldContext_Field_componentType(ctx, field) + case "componentProperties": + return ec.fieldContext_Field_componentProperties(ctx, field) + case "videoUrl": + return ec.fieldContext_Field_videoUrl(ctx, field) + case "thumbnailURL": + return ec.fieldContext_Field_thumbnailURL(ctx, field) + case "initialValue": + return ec.fieldContext_Field_initialValue(ctx, field) + } + return nil, fmt.Errorf("no field named %q was found under type Field", field.Name) + }, + } + return fc, nil +} + +func (ec *executionContext) _GetDestinationTypesResponse_categories(ctx context.Context, field graphql.CollectedField, obj *model.GetDestinationTypesResponse) (ret graphql.Marshaler) { + fc, err := ec.fieldContext_GetDestinationTypesResponse_categories(ctx, field) + if err != nil { + return graphql.Null + } + ctx = graphql.WithFieldContext(ctx, fc) + defer func() { + if r := recover(); r != nil { + ec.Error(ctx, ec.Recover(ctx, r)) + ret = graphql.Null + } + }() + resTmp, err := ec.ResolverMiddleware(ctx, func(rctx context.Context) (interface{}, error) { + ctx = rctx // use context from middleware stack in children + return obj.Categories, nil + }) + if err != nil { + ec.Error(ctx, err) + return graphql.Null + } + if resTmp == nil { + if !graphql.HasFieldError(ctx, fc) { + ec.Errorf(ctx, "must not be null") + } + return graphql.Null + } + res := resTmp.([]model.DestinationsCategory) + fc.Result = res + return ec.marshalNDestinationsCategory2ᚕgithubᚗcomᚋodigosᚑioᚋodigosᚋfrontendᚋgraphᚋmodelᚐDestinationsCategoryᚄ(ctx, field.Selections, res) +} + +func (ec *executionContext) fieldContext_GetDestinationTypesResponse_categories(_ context.Context, field graphql.CollectedField) (fc *graphql.FieldContext, err error) { + fc = &graphql.FieldContext{ + Object: "GetDestinationTypesResponse", + Field: field, + IsMethod: false, + IsResolver: false, + Child: func(ctx context.Context, field graphql.CollectedField) (*graphql.FieldContext, error) { + switch field.Name { + case "name": + return ec.fieldContext_DestinationsCategory_name(ctx, field) + case "items": + return ec.fieldContext_DestinationsCategory_items(ctx, field) + } + return nil, fmt.Errorf("no field named %q was found under type DestinationsCategory", field.Name) + }, + } + return fc, nil +} + +func (ec *executionContext) _IcaInstanceResponse_id(ctx context.Context, field graphql.CollectedField, obj *model.IcaInstanceResponse) (ret graphql.Marshaler) { + fc, err := ec.fieldContext_IcaInstanceResponse_id(ctx, field) + if err != nil { + return graphql.Null + } + ctx = graphql.WithFieldContext(ctx, fc) + defer func() { + if r := recover(); r != nil { + ec.Error(ctx, ec.Recover(ctx, r)) + ret = graphql.Null + } + }() + resTmp, err := ec.ResolverMiddleware(ctx, func(rctx context.Context) (interface{}, error) { + ctx = rctx // use context from middleware stack in children + return obj.ID, nil + }) + if err != nil { + ec.Error(ctx, err) + return graphql.Null + } + if resTmp == nil { + if !graphql.HasFieldError(ctx, fc) { + ec.Errorf(ctx, "must not be null") + } + return graphql.Null + } + res := resTmp.(string) + fc.Result = res + return ec.marshalNString2string(ctx, field.Selections, res) +} + +func (ec *executionContext) fieldContext_IcaInstanceResponse_id(_ context.Context, field graphql.CollectedField) (fc *graphql.FieldContext, err error) { + fc = &graphql.FieldContext{ + Object: "IcaInstanceResponse", + Field: field, + IsMethod: false, + IsResolver: false, + Child: func(ctx context.Context, field graphql.CollectedField) (*graphql.FieldContext, error) { + return nil, errors.New("field of type String does not have child fields") + }, + } + return fc, nil +} + +func (ec *executionContext) _IcaInstanceResponse_type(ctx context.Context, field graphql.CollectedField, obj *model.IcaInstanceResponse) (ret graphql.Marshaler) { + fc, err := ec.fieldContext_IcaInstanceResponse_type(ctx, field) + if err != nil { + return graphql.Null + } + ctx = graphql.WithFieldContext(ctx, fc) + defer func() { + if r := recover(); r != nil { + ec.Error(ctx, ec.Recover(ctx, r)) + ret = graphql.Null + } + }() + resTmp, err := ec.ResolverMiddleware(ctx, func(rctx context.Context) (interface{}, error) { + ctx = rctx // use context from middleware stack in children + return obj.Type, nil + }) + if err != nil { + ec.Error(ctx, err) + return graphql.Null + } + if resTmp == nil { + if !graphql.HasFieldError(ctx, fc) { + ec.Errorf(ctx, "must not be null") + } + return graphql.Null + } + res := resTmp.(string) + fc.Result = res + return ec.marshalNString2string(ctx, field.Selections, res) +} + +func (ec *executionContext) fieldContext_IcaInstanceResponse_type(_ context.Context, field graphql.CollectedField) (fc *graphql.FieldContext, err error) { + fc = &graphql.FieldContext{ + Object: "IcaInstanceResponse", + Field: field, + IsMethod: false, + IsResolver: false, + Child: func(ctx context.Context, field graphql.CollectedField) (*graphql.FieldContext, error) { + return nil, errors.New("field of type String does not have child fields") + }, + } + return fc, nil +} + +func (ec *executionContext) _IcaInstanceResponse_spec(ctx context.Context, field graphql.CollectedField, obj *model.IcaInstanceResponse) (ret graphql.Marshaler) { + fc, err := ec.fieldContext_IcaInstanceResponse_spec(ctx, field) + if err != nil { + return graphql.Null + } + ctx = graphql.WithFieldContext(ctx, fc) + defer func() { + if r := recover(); r != nil { + ec.Error(ctx, ec.Recover(ctx, r)) + ret = graphql.Null + } + }() + resTmp, err := ec.ResolverMiddleware(ctx, func(rctx context.Context) (interface{}, error) { + ctx = rctx // use context from middleware stack in children + return obj.Spec, nil + }) + if err != nil { + ec.Error(ctx, err) + return graphql.Null + } + if resTmp == nil { + if !graphql.HasFieldError(ctx, fc) { + ec.Errorf(ctx, "must not be null") + } + return graphql.Null + } + res := resTmp.(string) + fc.Result = res + return ec.marshalNString2string(ctx, field.Selections, res) +} + +func (ec *executionContext) fieldContext_IcaInstanceResponse_spec(_ context.Context, field graphql.CollectedField) (fc *graphql.FieldContext, err error) { + fc = &graphql.FieldContext{ + Object: "IcaInstanceResponse", + Field: field, + IsMethod: false, + IsResolver: false, + Child: func(ctx context.Context, field graphql.CollectedField) (*graphql.FieldContext, error) { + return nil, errors.New("field of type String does not have child fields") + }, + } + return fc, nil +} + +func (ec *executionContext) _InstrumentationLibrary_libraryName(ctx context.Context, field graphql.CollectedField, obj *model.InstrumentationLibrary) (ret graphql.Marshaler) { + fc, err := ec.fieldContext_InstrumentationLibrary_libraryName(ctx, field) + if err != nil { + return graphql.Null + } + ctx = graphql.WithFieldContext(ctx, fc) + defer func() { + if r := recover(); r != nil { + ec.Error(ctx, ec.Recover(ctx, r)) + ret = graphql.Null + } + }() + resTmp, err := ec.ResolverMiddleware(ctx, func(rctx context.Context) (interface{}, error) { + ctx = rctx // use context from middleware stack in children + return obj.LibraryName, nil + }) + if err != nil { + ec.Error(ctx, err) + return graphql.Null + } + if resTmp == nil { + if !graphql.HasFieldError(ctx, fc) { + ec.Errorf(ctx, "must not be null") + } + return graphql.Null + } + res := resTmp.(string) + fc.Result = res + return ec.marshalNString2string(ctx, field.Selections, res) +} + +func (ec *executionContext) fieldContext_InstrumentationLibrary_libraryName(_ context.Context, field graphql.CollectedField) (fc *graphql.FieldContext, err error) { + fc = &graphql.FieldContext{ + Object: "InstrumentationLibrary", + Field: field, + IsMethod: false, + IsResolver: false, + Child: func(ctx context.Context, field graphql.CollectedField) (*graphql.FieldContext, error) { + return nil, errors.New("field of type String does not have child fields") + }, + } + return fc, nil +} + +func (ec *executionContext) _InstrumentationLibrary_options(ctx context.Context, field graphql.CollectedField, obj *model.InstrumentationLibrary) (ret graphql.Marshaler) { + fc, err := ec.fieldContext_InstrumentationLibrary_options(ctx, field) + if err != nil { + return graphql.Null + } + ctx = graphql.WithFieldContext(ctx, fc) + defer func() { + if r := recover(); r != nil { + ec.Error(ctx, ec.Recover(ctx, r)) + ret = graphql.Null + } + }() + resTmp, err := ec.ResolverMiddleware(ctx, func(rctx context.Context) (interface{}, error) { + ctx = rctx // use context from middleware stack in children + return obj.Options, nil + }) + if err != nil { + ec.Error(ctx, err) + return graphql.Null + } + if resTmp == nil { + if !graphql.HasFieldError(ctx, fc) { + ec.Errorf(ctx, "must not be null") + } + return graphql.Null + } + res := resTmp.([]*model.InstrumentationOption) + fc.Result = res + return ec.marshalNInstrumentationOption2ᚕᚖgithubᚗcomᚋodigosᚑioᚋodigosᚋfrontendᚋgraphᚋmodelᚐInstrumentationOptionᚄ(ctx, field.Selections, res) +} + +func (ec *executionContext) fieldContext_InstrumentationLibrary_options(_ context.Context, field graphql.CollectedField) (fc *graphql.FieldContext, err error) { + fc = &graphql.FieldContext{ + Object: "InstrumentationLibrary", + Field: field, + IsMethod: false, + IsResolver: false, + Child: func(ctx context.Context, field graphql.CollectedField) (*graphql.FieldContext, error) { + switch field.Name { + case "optionKey": + return ec.fieldContext_InstrumentationOption_optionKey(ctx, field) + case "spanKind": + return ec.fieldContext_InstrumentationOption_spanKind(ctx, field) + } + return nil, fmt.Errorf("no field named %q was found under type InstrumentationOption", field.Name) + }, + } + return fc, nil +} + +func (ec *executionContext) _InstrumentationOption_optionKey(ctx context.Context, field graphql.CollectedField, obj *model.InstrumentationOption) (ret graphql.Marshaler) { + fc, err := ec.fieldContext_InstrumentationOption_optionKey(ctx, field) + if err != nil { + return graphql.Null + } + ctx = graphql.WithFieldContext(ctx, fc) + defer func() { + if r := recover(); r != nil { + ec.Error(ctx, ec.Recover(ctx, r)) + ret = graphql.Null + } + }() + resTmp, err := ec.ResolverMiddleware(ctx, func(rctx context.Context) (interface{}, error) { + ctx = rctx // use context from middleware stack in children + return obj.OptionKey, nil + }) + if err != nil { + ec.Error(ctx, err) + return graphql.Null + } + if resTmp == nil { + if !graphql.HasFieldError(ctx, fc) { + ec.Errorf(ctx, "must not be null") + } + return graphql.Null + } + res := resTmp.(string) + fc.Result = res + return ec.marshalNString2string(ctx, field.Selections, res) +} + +func (ec *executionContext) fieldContext_InstrumentationOption_optionKey(_ context.Context, field graphql.CollectedField) (fc *graphql.FieldContext, err error) { + fc = &graphql.FieldContext{ + Object: "InstrumentationOption", + Field: field, + IsMethod: false, + IsResolver: false, + Child: func(ctx context.Context, field graphql.CollectedField) (*graphql.FieldContext, error) { + return nil, errors.New("field of type String does not have child fields") + }, + } + return fc, nil +} + +func (ec *executionContext) _InstrumentationOption_spanKind(ctx context.Context, field graphql.CollectedField, obj *model.InstrumentationOption) (ret graphql.Marshaler) { + fc, err := ec.fieldContext_InstrumentationOption_spanKind(ctx, field) + if err != nil { + return graphql.Null + } + ctx = graphql.WithFieldContext(ctx, fc) + defer func() { + if r := recover(); r != nil { + ec.Error(ctx, ec.Recover(ctx, r)) + ret = graphql.Null + } + }() + resTmp, err := ec.ResolverMiddleware(ctx, func(rctx context.Context) (interface{}, error) { + ctx = rctx // use context from middleware stack in children + return obj.SpanKind, nil + }) + if err != nil { + ec.Error(ctx, err) + return graphql.Null + } + if resTmp == nil { + if !graphql.HasFieldError(ctx, fc) { + ec.Errorf(ctx, "must not be null") + } + return graphql.Null + } + res := resTmp.(model.SpanKind) + fc.Result = res + return ec.marshalNSpanKind2githubᚗcomᚋodigosᚑioᚋodigosᚋfrontendᚋgraphᚋmodelᚐSpanKind(ctx, field.Selections, res) +} + +func (ec *executionContext) fieldContext_InstrumentationOption_spanKind(_ context.Context, field graphql.CollectedField) (fc *graphql.FieldContext, err error) { + fc = &graphql.FieldContext{ + Object: "InstrumentationOption", + Field: field, + IsMethod: false, + IsResolver: false, + Child: func(ctx context.Context, field graphql.CollectedField) (*graphql.FieldContext, error) { + return nil, errors.New("field of type SpanKind does not have child fields") + }, + } + return fc, nil +} + +func (ec *executionContext) _InstrumentedApplicationDetails_containers(ctx context.Context, field graphql.CollectedField, obj *model.InstrumentedApplicationDetails) (ret graphql.Marshaler) { + fc, err := ec.fieldContext_InstrumentedApplicationDetails_containers(ctx, field) + if err != nil { + return graphql.Null + } + ctx = graphql.WithFieldContext(ctx, fc) + defer func() { + if r := recover(); r != nil { + ec.Error(ctx, ec.Recover(ctx, r)) + ret = graphql.Null + } + }() + resTmp, err := ec.ResolverMiddleware(ctx, func(rctx context.Context) (interface{}, error) { + ctx = rctx // use context from middleware stack in children + return obj.Containers, nil + }) + if err != nil { + ec.Error(ctx, err) + return graphql.Null + } + if resTmp == nil { + return graphql.Null + } + res := resTmp.([]*model.SourceContainerRuntimeDetails) + fc.Result = res + return ec.marshalOSourceContainerRuntimeDetails2ᚕᚖgithubᚗcomᚋodigosᚑioᚋodigosᚋfrontendᚋgraphᚋmodelᚐSourceContainerRuntimeDetailsᚄ(ctx, field.Selections, res) +} + +func (ec *executionContext) fieldContext_InstrumentedApplicationDetails_containers(_ context.Context, field graphql.CollectedField) (fc *graphql.FieldContext, err error) { + fc = &graphql.FieldContext{ + Object: "InstrumentedApplicationDetails", + Field: field, + IsMethod: false, + IsResolver: false, + Child: func(ctx context.Context, field graphql.CollectedField) (*graphql.FieldContext, error) { + switch field.Name { + case "containerName": + return ec.fieldContext_SourceContainerRuntimeDetails_containerName(ctx, field) + case "language": + return ec.fieldContext_SourceContainerRuntimeDetails_language(ctx, field) + } + return nil, fmt.Errorf("no field named %q was found under type SourceContainerRuntimeDetails", field.Name) + }, + } + return fc, nil +} + +func (ec *executionContext) _InstrumentedApplicationDetails_conditions(ctx context.Context, field graphql.CollectedField, obj *model.InstrumentedApplicationDetails) (ret graphql.Marshaler) { + fc, err := ec.fieldContext_InstrumentedApplicationDetails_conditions(ctx, field) + if err != nil { + return graphql.Null + } + ctx = graphql.WithFieldContext(ctx, fc) + defer func() { + if r := recover(); r != nil { + ec.Error(ctx, ec.Recover(ctx, r)) + ret = graphql.Null + } + }() + resTmp, err := ec.ResolverMiddleware(ctx, func(rctx context.Context) (interface{}, error) { + ctx = rctx // use context from middleware stack in children + return obj.Conditions, nil + }) + if err != nil { + ec.Error(ctx, err) + return graphql.Null + } + if resTmp == nil { + return graphql.Null + } + res := resTmp.([]*model.Condition) + fc.Result = res + return ec.marshalOCondition2ᚕᚖgithubᚗcomᚋodigosᚑioᚋodigosᚋfrontendᚋgraphᚋmodelᚐConditionᚄ(ctx, field.Selections, res) +} + +func (ec *executionContext) fieldContext_InstrumentedApplicationDetails_conditions(_ context.Context, field graphql.CollectedField) (fc *graphql.FieldContext, err error) { + fc = &graphql.FieldContext{ + Object: "InstrumentedApplicationDetails", + Field: field, + IsMethod: false, + IsResolver: false, + Child: func(ctx context.Context, field graphql.CollectedField) (*graphql.FieldContext, error) { + switch field.Name { + case "type": + return ec.fieldContext_Condition_type(ctx, field) + case "status": + return ec.fieldContext_Condition_status(ctx, field) + case "lastTransitionTime": + return ec.fieldContext_Condition_lastTransitionTime(ctx, field) + case "reason": + return ec.fieldContext_Condition_reason(ctx, field) + case "message": + return ec.fieldContext_Condition_message(ctx, field) + } + return nil, fmt.Errorf("no field named %q was found under type Condition", field.Name) + }, + } + return fc, nil +} + +func (ec *executionContext) _InstrumentedApplicationDetails_instrumentationOptions(ctx context.Context, field graphql.CollectedField, obj *model.InstrumentedApplicationDetails) (ret graphql.Marshaler) { + fc, err := ec.fieldContext_InstrumentedApplicationDetails_instrumentationOptions(ctx, field) + if err != nil { + return graphql.Null + } + ctx = graphql.WithFieldContext(ctx, fc) + defer func() { + if r := recover(); r != nil { + ec.Error(ctx, ec.Recover(ctx, r)) + ret = graphql.Null + } + }() + resTmp, err := ec.ResolverMiddleware(ctx, func(rctx context.Context) (interface{}, error) { + ctx = rctx // use context from middleware stack in children + return obj.InstrumentationOptions, nil + }) + if err != nil { + ec.Error(ctx, err) + return graphql.Null + } + if resTmp == nil { + if !graphql.HasFieldError(ctx, fc) { + ec.Errorf(ctx, "must not be null") + } + return graphql.Null + } + res := resTmp.([]*model.InstrumentationLibrary) + fc.Result = res + return ec.marshalNInstrumentationLibrary2ᚕᚖgithubᚗcomᚋodigosᚑioᚋodigosᚋfrontendᚋgraphᚋmodelᚐInstrumentationLibraryᚄ(ctx, field.Selections, res) +} + +func (ec *executionContext) fieldContext_InstrumentedApplicationDetails_instrumentationOptions(_ context.Context, field graphql.CollectedField) (fc *graphql.FieldContext, err error) { + fc = &graphql.FieldContext{ + Object: "InstrumentedApplicationDetails", + Field: field, + IsMethod: false, + IsResolver: false, + Child: func(ctx context.Context, field graphql.CollectedField) (*graphql.FieldContext, error) { + switch field.Name { + case "libraryName": + return ec.fieldContext_InstrumentationLibrary_libraryName(ctx, field) + case "options": + return ec.fieldContext_InstrumentationLibrary_options(ctx, field) + } + return nil, fmt.Errorf("no field named %q was found under type InstrumentationLibrary", field.Name) + }, + } + return fc, nil +} + +func (ec *executionContext) _K8sActualNamespace_name(ctx context.Context, field graphql.CollectedField, obj *model.K8sActualNamespace) (ret graphql.Marshaler) { + fc, err := ec.fieldContext_K8sActualNamespace_name(ctx, field) + if err != nil { + return graphql.Null + } + ctx = graphql.WithFieldContext(ctx, fc) + defer func() { + if r := recover(); r != nil { + ec.Error(ctx, ec.Recover(ctx, r)) + ret = graphql.Null + } + }() + resTmp, err := ec.ResolverMiddleware(ctx, func(rctx context.Context) (interface{}, error) { + ctx = rctx // use context from middleware stack in children + return obj.Name, nil + }) + if err != nil { + ec.Error(ctx, err) + return graphql.Null + } + if resTmp == nil { + if !graphql.HasFieldError(ctx, fc) { + ec.Errorf(ctx, "must not be null") + } + return graphql.Null + } + res := resTmp.(string) + fc.Result = res + return ec.marshalNString2string(ctx, field.Selections, res) +} + +func (ec *executionContext) fieldContext_K8sActualNamespace_name(_ context.Context, field graphql.CollectedField) (fc *graphql.FieldContext, err error) { + fc = &graphql.FieldContext{ + Object: "K8sActualNamespace", + Field: field, + IsMethod: false, + IsResolver: false, + Child: func(ctx context.Context, field graphql.CollectedField) (*graphql.FieldContext, error) { + return nil, errors.New("field of type String does not have child fields") + }, + } + return fc, nil +} + +func (ec *executionContext) _K8sActualNamespace_instrumentationLabelEnabled(ctx context.Context, field graphql.CollectedField, obj *model.K8sActualNamespace) (ret graphql.Marshaler) { + fc, err := ec.fieldContext_K8sActualNamespace_instrumentationLabelEnabled(ctx, field) + if err != nil { + return graphql.Null + } + ctx = graphql.WithFieldContext(ctx, fc) + defer func() { + if r := recover(); r != nil { + ec.Error(ctx, ec.Recover(ctx, r)) + ret = graphql.Null + } + }() + resTmp, err := ec.ResolverMiddleware(ctx, func(rctx context.Context) (interface{}, error) { + ctx = rctx // use context from middleware stack in children + return obj.InstrumentationLabelEnabled, nil + }) + if err != nil { + ec.Error(ctx, err) + return graphql.Null + } + if resTmp == nil { + return graphql.Null + } + res := resTmp.(*bool) + fc.Result = res + return ec.marshalOBoolean2ᚖbool(ctx, field.Selections, res) +} + +func (ec *executionContext) fieldContext_K8sActualNamespace_instrumentationLabelEnabled(_ context.Context, field graphql.CollectedField) (fc *graphql.FieldContext, err error) { + fc = &graphql.FieldContext{ + Object: "K8sActualNamespace", + Field: field, + IsMethod: false, + IsResolver: false, + Child: func(ctx context.Context, field graphql.CollectedField) (*graphql.FieldContext, error) { + return nil, errors.New("field of type Boolean does not have child fields") + }, + } + return fc, nil +} + +func (ec *executionContext) _K8sActualNamespace_k8sActualSources(ctx context.Context, field graphql.CollectedField, obj *model.K8sActualNamespace) (ret graphql.Marshaler) { + fc, err := ec.fieldContext_K8sActualNamespace_k8sActualSources(ctx, field) + if err != nil { + return graphql.Null + } + ctx = graphql.WithFieldContext(ctx, fc) + defer func() { + if r := recover(); r != nil { + ec.Error(ctx, ec.Recover(ctx, r)) + ret = graphql.Null + } + }() + resTmp, err := ec.ResolverMiddleware(ctx, func(rctx context.Context) (interface{}, error) { + ctx = rctx // use context from middleware stack in children + return ec.resolvers.K8sActualNamespace().K8sActualSources(rctx, obj, fc.Args["instrumentationLabeled"].(*bool)) + }) + if err != nil { + ec.Error(ctx, err) + return graphql.Null + } + if resTmp == nil { + if !graphql.HasFieldError(ctx, fc) { + ec.Errorf(ctx, "must not be null") + } + return graphql.Null + } + res := resTmp.([]*model.K8sActualSource) + fc.Result = res + return ec.marshalNK8sActualSource2ᚕᚖgithubᚗcomᚋodigosᚑioᚋodigosᚋfrontendᚋgraphᚋmodelᚐK8sActualSource(ctx, field.Selections, res) +} + +func (ec *executionContext) fieldContext_K8sActualNamespace_k8sActualSources(ctx context.Context, field graphql.CollectedField) (fc *graphql.FieldContext, err error) { + fc = &graphql.FieldContext{ + Object: "K8sActualNamespace", + Field: field, + IsMethod: true, + IsResolver: true, + Child: func(ctx context.Context, field graphql.CollectedField) (*graphql.FieldContext, error) { + switch field.Name { + case "namespace": + return ec.fieldContext_K8sActualSource_namespace(ctx, field) + case "kind": + return ec.fieldContext_K8sActualSource_kind(ctx, field) + case "name": + return ec.fieldContext_K8sActualSource_name(ctx, field) + case "serviceName": + return ec.fieldContext_K8sActualSource_serviceName(ctx, field) + case "numberOfInstances": + return ec.fieldContext_K8sActualSource_numberOfInstances(ctx, field) + case "reportedName": + return ec.fieldContext_K8sActualSource_reportedName(ctx, field) + case "autoInstrumented": + return ec.fieldContext_K8sActualSource_autoInstrumented(ctx, field) + case "autoInstrumentedDecision": + return ec.fieldContext_K8sActualSource_autoInstrumentedDecision(ctx, field) + case "instrumentedApplicationDetails": + return ec.fieldContext_K8sActualSource_instrumentedApplicationDetails(ctx, field) + } + return nil, fmt.Errorf("no field named %q was found under type K8sActualSource", field.Name) + }, + } + defer func() { + if r := recover(); r != nil { + err = ec.Recover(ctx, r) + ec.Error(ctx, err) + } + }() + ctx = graphql.WithFieldContext(ctx, fc) + if fc.Args, err = ec.field_K8sActualNamespace_k8sActualSources_args(ctx, field.ArgumentMap(ec.Variables)); err != nil { + ec.Error(ctx, err) + return fc, err + } + return fc, nil +} + +func (ec *executionContext) _K8sActualSource_namespace(ctx context.Context, field graphql.CollectedField, obj *model.K8sActualSource) (ret graphql.Marshaler) { + fc, err := ec.fieldContext_K8sActualSource_namespace(ctx, field) + if err != nil { + return graphql.Null + } + ctx = graphql.WithFieldContext(ctx, fc) + defer func() { + if r := recover(); r != nil { + ec.Error(ctx, ec.Recover(ctx, r)) + ret = graphql.Null + } + }() + resTmp, err := ec.ResolverMiddleware(ctx, func(rctx context.Context) (interface{}, error) { + ctx = rctx // use context from middleware stack in children + return obj.Namespace, nil + }) + if err != nil { + ec.Error(ctx, err) + return graphql.Null + } + if resTmp == nil { + if !graphql.HasFieldError(ctx, fc) { + ec.Errorf(ctx, "must not be null") + } + return graphql.Null + } + res := resTmp.(string) + fc.Result = res + return ec.marshalNString2string(ctx, field.Selections, res) +} + +func (ec *executionContext) fieldContext_K8sActualSource_namespace(_ context.Context, field graphql.CollectedField) (fc *graphql.FieldContext, err error) { + fc = &graphql.FieldContext{ + Object: "K8sActualSource", + Field: field, + IsMethod: false, + IsResolver: false, + Child: func(ctx context.Context, field graphql.CollectedField) (*graphql.FieldContext, error) { + return nil, errors.New("field of type String does not have child fields") + }, + } + return fc, nil +} + +func (ec *executionContext) _K8sActualSource_kind(ctx context.Context, field graphql.CollectedField, obj *model.K8sActualSource) (ret graphql.Marshaler) { + fc, err := ec.fieldContext_K8sActualSource_kind(ctx, field) + if err != nil { + return graphql.Null + } + ctx = graphql.WithFieldContext(ctx, fc) + defer func() { + if r := recover(); r != nil { + ec.Error(ctx, ec.Recover(ctx, r)) + ret = graphql.Null + } + }() + resTmp, err := ec.ResolverMiddleware(ctx, func(rctx context.Context) (interface{}, error) { + ctx = rctx // use context from middleware stack in children + return obj.Kind, nil + }) + if err != nil { + ec.Error(ctx, err) + return graphql.Null + } + if resTmp == nil { + if !graphql.HasFieldError(ctx, fc) { + ec.Errorf(ctx, "must not be null") + } + return graphql.Null + } + res := resTmp.(model.K8sResourceKind) + fc.Result = res + return ec.marshalNK8sResourceKind2githubᚗcomᚋodigosᚑioᚋodigosᚋfrontendᚋgraphᚋmodelᚐK8sResourceKind(ctx, field.Selections, res) +} + +func (ec *executionContext) fieldContext_K8sActualSource_kind(_ context.Context, field graphql.CollectedField) (fc *graphql.FieldContext, err error) { + fc = &graphql.FieldContext{ + Object: "K8sActualSource", + Field: field, + IsMethod: false, + IsResolver: false, + Child: func(ctx context.Context, field graphql.CollectedField) (*graphql.FieldContext, error) { + return nil, errors.New("field of type K8sResourceKind does not have child fields") + }, + } + return fc, nil +} + +func (ec *executionContext) _K8sActualSource_name(ctx context.Context, field graphql.CollectedField, obj *model.K8sActualSource) (ret graphql.Marshaler) { + fc, err := ec.fieldContext_K8sActualSource_name(ctx, field) + if err != nil { + return graphql.Null + } + ctx = graphql.WithFieldContext(ctx, fc) + defer func() { + if r := recover(); r != nil { + ec.Error(ctx, ec.Recover(ctx, r)) + ret = graphql.Null + } + }() + resTmp, err := ec.ResolverMiddleware(ctx, func(rctx context.Context) (interface{}, error) { + ctx = rctx // use context from middleware stack in children + return obj.Name, nil + }) + if err != nil { + ec.Error(ctx, err) + return graphql.Null + } + if resTmp == nil { + if !graphql.HasFieldError(ctx, fc) { + ec.Errorf(ctx, "must not be null") + } + return graphql.Null + } + res := resTmp.(string) + fc.Result = res + return ec.marshalNString2string(ctx, field.Selections, res) +} + +func (ec *executionContext) fieldContext_K8sActualSource_name(_ context.Context, field graphql.CollectedField) (fc *graphql.FieldContext, err error) { + fc = &graphql.FieldContext{ + Object: "K8sActualSource", + Field: field, + IsMethod: false, + IsResolver: false, + Child: func(ctx context.Context, field graphql.CollectedField) (*graphql.FieldContext, error) { + return nil, errors.New("field of type String does not have child fields") + }, + } + return fc, nil +} + +func (ec *executionContext) _K8sActualSource_serviceName(ctx context.Context, field graphql.CollectedField, obj *model.K8sActualSource) (ret graphql.Marshaler) { + fc, err := ec.fieldContext_K8sActualSource_serviceName(ctx, field) + if err != nil { + return graphql.Null + } + ctx = graphql.WithFieldContext(ctx, fc) + defer func() { + if r := recover(); r != nil { + ec.Error(ctx, ec.Recover(ctx, r)) + ret = graphql.Null + } + }() + resTmp, err := ec.ResolverMiddleware(ctx, func(rctx context.Context) (interface{}, error) { + ctx = rctx // use context from middleware stack in children + return obj.ServiceName, nil + }) + if err != nil { + ec.Error(ctx, err) + return graphql.Null + } + if resTmp == nil { + return graphql.Null + } + res := resTmp.(*string) + fc.Result = res + return ec.marshalOString2ᚖstring(ctx, field.Selections, res) +} + +func (ec *executionContext) fieldContext_K8sActualSource_serviceName(_ context.Context, field graphql.CollectedField) (fc *graphql.FieldContext, err error) { + fc = &graphql.FieldContext{ + Object: "K8sActualSource", + Field: field, + IsMethod: false, + IsResolver: false, + Child: func(ctx context.Context, field graphql.CollectedField) (*graphql.FieldContext, error) { + return nil, errors.New("field of type String does not have child fields") + }, + } + return fc, nil +} + +func (ec *executionContext) _K8sActualSource_numberOfInstances(ctx context.Context, field graphql.CollectedField, obj *model.K8sActualSource) (ret graphql.Marshaler) { + fc, err := ec.fieldContext_K8sActualSource_numberOfInstances(ctx, field) + if err != nil { + return graphql.Null + } + ctx = graphql.WithFieldContext(ctx, fc) + defer func() { + if r := recover(); r != nil { + ec.Error(ctx, ec.Recover(ctx, r)) + ret = graphql.Null + } + }() + resTmp, err := ec.ResolverMiddleware(ctx, func(rctx context.Context) (interface{}, error) { + ctx = rctx // use context from middleware stack in children + return obj.NumberOfInstances, nil + }) + if err != nil { + ec.Error(ctx, err) + return graphql.Null + } + if resTmp == nil { + return graphql.Null + } + res := resTmp.(*int) + fc.Result = res + return ec.marshalOInt2ᚖint(ctx, field.Selections, res) +} + +func (ec *executionContext) fieldContext_K8sActualSource_numberOfInstances(_ context.Context, field graphql.CollectedField) (fc *graphql.FieldContext, err error) { + fc = &graphql.FieldContext{ + Object: "K8sActualSource", + Field: field, + IsMethod: false, + IsResolver: false, + Child: func(ctx context.Context, field graphql.CollectedField) (*graphql.FieldContext, error) { + return nil, errors.New("field of type Int does not have child fields") + }, + } + return fc, nil +} + +func (ec *executionContext) _K8sActualSource_reportedName(ctx context.Context, field graphql.CollectedField, obj *model.K8sActualSource) (ret graphql.Marshaler) { + fc, err := ec.fieldContext_K8sActualSource_reportedName(ctx, field) + if err != nil { + return graphql.Null + } + ctx = graphql.WithFieldContext(ctx, fc) + defer func() { + if r := recover(); r != nil { + ec.Error(ctx, ec.Recover(ctx, r)) + ret = graphql.Null + } + }() + resTmp, err := ec.ResolverMiddleware(ctx, func(rctx context.Context) (interface{}, error) { + ctx = rctx // use context from middleware stack in children + return obj.ReportedName, nil + }) + if err != nil { + ec.Error(ctx, err) + return graphql.Null + } + if resTmp == nil { + return graphql.Null + } + res := resTmp.(*string) + fc.Result = res + return ec.marshalOString2ᚖstring(ctx, field.Selections, res) +} + +func (ec *executionContext) fieldContext_K8sActualSource_reportedName(_ context.Context, field graphql.CollectedField) (fc *graphql.FieldContext, err error) { + fc = &graphql.FieldContext{ + Object: "K8sActualSource", + Field: field, + IsMethod: false, + IsResolver: false, + Child: func(ctx context.Context, field graphql.CollectedField) (*graphql.FieldContext, error) { + return nil, errors.New("field of type String does not have child fields") + }, + } + return fc, nil +} + +func (ec *executionContext) _K8sActualSource_autoInstrumented(ctx context.Context, field graphql.CollectedField, obj *model.K8sActualSource) (ret graphql.Marshaler) { + fc, err := ec.fieldContext_K8sActualSource_autoInstrumented(ctx, field) + if err != nil { + return graphql.Null + } + ctx = graphql.WithFieldContext(ctx, fc) + defer func() { + if r := recover(); r != nil { + ec.Error(ctx, ec.Recover(ctx, r)) + ret = graphql.Null + } + }() + resTmp, err := ec.ResolverMiddleware(ctx, func(rctx context.Context) (interface{}, error) { + ctx = rctx // use context from middleware stack in children + return obj.AutoInstrumented, nil + }) + if err != nil { + ec.Error(ctx, err) + return graphql.Null + } + if resTmp == nil { + if !graphql.HasFieldError(ctx, fc) { + ec.Errorf(ctx, "must not be null") + } + return graphql.Null + } + res := resTmp.(bool) + fc.Result = res + return ec.marshalNBoolean2bool(ctx, field.Selections, res) +} + +func (ec *executionContext) fieldContext_K8sActualSource_autoInstrumented(_ context.Context, field graphql.CollectedField) (fc *graphql.FieldContext, err error) { + fc = &graphql.FieldContext{ + Object: "K8sActualSource", + Field: field, + IsMethod: false, + IsResolver: false, + Child: func(ctx context.Context, field graphql.CollectedField) (*graphql.FieldContext, error) { + return nil, errors.New("field of type Boolean does not have child fields") + }, + } + return fc, nil +} + +func (ec *executionContext) _K8sActualSource_autoInstrumentedDecision(ctx context.Context, field graphql.CollectedField, obj *model.K8sActualSource) (ret graphql.Marshaler) { + fc, err := ec.fieldContext_K8sActualSource_autoInstrumentedDecision(ctx, field) + if err != nil { + return graphql.Null + } + ctx = graphql.WithFieldContext(ctx, fc) + defer func() { + if r := recover(); r != nil { + ec.Error(ctx, ec.Recover(ctx, r)) + ret = graphql.Null + } + }() + resTmp, err := ec.ResolverMiddleware(ctx, func(rctx context.Context) (interface{}, error) { + ctx = rctx // use context from middleware stack in children + return obj.AutoInstrumentedDecision, nil + }) + if err != nil { + ec.Error(ctx, err) + return graphql.Null + } + if resTmp == nil { + if !graphql.HasFieldError(ctx, fc) { + ec.Errorf(ctx, "must not be null") + } + return graphql.Null + } + res := resTmp.(string) + fc.Result = res + return ec.marshalNString2string(ctx, field.Selections, res) +} + +func (ec *executionContext) fieldContext_K8sActualSource_autoInstrumentedDecision(_ context.Context, field graphql.CollectedField) (fc *graphql.FieldContext, err error) { + fc = &graphql.FieldContext{ + Object: "K8sActualSource", + Field: field, + IsMethod: false, + IsResolver: false, + Child: func(ctx context.Context, field graphql.CollectedField) (*graphql.FieldContext, error) { + return nil, errors.New("field of type String does not have child fields") + }, + } + return fc, nil +} + +func (ec *executionContext) _K8sActualSource_instrumentedApplicationDetails(ctx context.Context, field graphql.CollectedField, obj *model.K8sActualSource) (ret graphql.Marshaler) { + fc, err := ec.fieldContext_K8sActualSource_instrumentedApplicationDetails(ctx, field) + if err != nil { + return graphql.Null + } + ctx = graphql.WithFieldContext(ctx, fc) + defer func() { + if r := recover(); r != nil { + ec.Error(ctx, ec.Recover(ctx, r)) + ret = graphql.Null + } + }() + resTmp, err := ec.ResolverMiddleware(ctx, func(rctx context.Context) (interface{}, error) { + ctx = rctx // use context from middleware stack in children + return obj.InstrumentedApplicationDetails, nil + }) + if err != nil { + ec.Error(ctx, err) + return graphql.Null + } + if resTmp == nil { + return graphql.Null + } + res := resTmp.(*model.InstrumentedApplicationDetails) + fc.Result = res + return ec.marshalOInstrumentedApplicationDetails2ᚖgithubᚗcomᚋodigosᚑioᚋodigosᚋfrontendᚋgraphᚋmodelᚐInstrumentedApplicationDetails(ctx, field.Selections, res) +} + +func (ec *executionContext) fieldContext_K8sActualSource_instrumentedApplicationDetails(_ context.Context, field graphql.CollectedField) (fc *graphql.FieldContext, err error) { + fc = &graphql.FieldContext{ + Object: "K8sActualSource", + Field: field, + IsMethod: false, + IsResolver: false, + Child: func(ctx context.Context, field graphql.CollectedField) (*graphql.FieldContext, error) { + switch field.Name { + case "containers": + return ec.fieldContext_InstrumentedApplicationDetails_containers(ctx, field) + case "conditions": + return ec.fieldContext_InstrumentedApplicationDetails_conditions(ctx, field) + case "instrumentationOptions": + return ec.fieldContext_InstrumentedApplicationDetails_instrumentationOptions(ctx, field) + } + return nil, fmt.Errorf("no field named %q was found under type InstrumentedApplicationDetails", field.Name) + }, + } + return fc, nil +} + +func (ec *executionContext) _Mutation_createNewDestination(ctx context.Context, field graphql.CollectedField) (ret graphql.Marshaler) { + fc, err := ec.fieldContext_Mutation_createNewDestination(ctx, field) + if err != nil { + return graphql.Null + } + ctx = graphql.WithFieldContext(ctx, fc) + defer func() { + if r := recover(); r != nil { + ec.Error(ctx, ec.Recover(ctx, r)) + ret = graphql.Null + } + }() + resTmp, err := ec.ResolverMiddleware(ctx, func(rctx context.Context) (interface{}, error) { + ctx = rctx // use context from middleware stack in children + return ec.resolvers.Mutation().CreateNewDestination(rctx, fc.Args["destination"].(model.DestinationInput)) + }) + if err != nil { + ec.Error(ctx, err) + return graphql.Null + } + if resTmp == nil { + if !graphql.HasFieldError(ctx, fc) { + ec.Errorf(ctx, "must not be null") + } + return graphql.Null + } + res := resTmp.(*model.Destination) + fc.Result = res + return ec.marshalNDestination2ᚖgithubᚗcomᚋodigosᚑioᚋodigosᚋfrontendᚋgraphᚋmodelᚐDestination(ctx, field.Selections, res) +} + +func (ec *executionContext) fieldContext_Mutation_createNewDestination(ctx context.Context, field graphql.CollectedField) (fc *graphql.FieldContext, err error) { + fc = &graphql.FieldContext{ + Object: "Mutation", + Field: field, + IsMethod: true, + IsResolver: true, + Child: func(ctx context.Context, field graphql.CollectedField) (*graphql.FieldContext, error) { + switch field.Name { + case "id": + return ec.fieldContext_Destination_id(ctx, field) + case "name": + return ec.fieldContext_Destination_name(ctx, field) + case "type": + return ec.fieldContext_Destination_type(ctx, field) + case "exportedSignals": + return ec.fieldContext_Destination_exportedSignals(ctx, field) + case "fields": + return ec.fieldContext_Destination_fields(ctx, field) + case "destinationType": + return ec.fieldContext_Destination_destinationType(ctx, field) + case "conditions": + return ec.fieldContext_Destination_conditions(ctx, field) + } + return nil, fmt.Errorf("no field named %q was found under type Destination", field.Name) + }, + } + defer func() { + if r := recover(); r != nil { + err = ec.Recover(ctx, r) + ec.Error(ctx, err) + } + }() + ctx = graphql.WithFieldContext(ctx, fc) + if fc.Args, err = ec.field_Mutation_createNewDestination_args(ctx, field.ArgumentMap(ec.Variables)); err != nil { + ec.Error(ctx, err) + return fc, err + } + return fc, nil +} + +func (ec *executionContext) _Mutation_persistK8sNamespace(ctx context.Context, field graphql.CollectedField) (ret graphql.Marshaler) { + fc, err := ec.fieldContext_Mutation_persistK8sNamespace(ctx, field) + if err != nil { + return graphql.Null + } + ctx = graphql.WithFieldContext(ctx, fc) + defer func() { + if r := recover(); r != nil { + ec.Error(ctx, ec.Recover(ctx, r)) + ret = graphql.Null + } + }() + resTmp, err := ec.ResolverMiddleware(ctx, func(rctx context.Context) (interface{}, error) { + ctx = rctx // use context from middleware stack in children + return ec.resolvers.Mutation().PersistK8sNamespace(rctx, fc.Args["namespace"].(model.PersistNamespaceItemInput)) + }) + if err != nil { + ec.Error(ctx, err) + return graphql.Null + } + if resTmp == nil { + if !graphql.HasFieldError(ctx, fc) { + ec.Errorf(ctx, "must not be null") + } + return graphql.Null + } + res := resTmp.(bool) + fc.Result = res + return ec.marshalNBoolean2bool(ctx, field.Selections, res) +} + +func (ec *executionContext) fieldContext_Mutation_persistK8sNamespace(ctx context.Context, field graphql.CollectedField) (fc *graphql.FieldContext, err error) { + fc = &graphql.FieldContext{ + Object: "Mutation", + Field: field, + IsMethod: true, + IsResolver: true, + Child: func(ctx context.Context, field graphql.CollectedField) (*graphql.FieldContext, error) { + return nil, errors.New("field of type Boolean does not have child fields") + }, + } + defer func() { + if r := recover(); r != nil { + err = ec.Recover(ctx, r) + ec.Error(ctx, err) + } + }() + ctx = graphql.WithFieldContext(ctx, fc) + if fc.Args, err = ec.field_Mutation_persistK8sNamespace_args(ctx, field.ArgumentMap(ec.Variables)); err != nil { + ec.Error(ctx, err) + return fc, err + } + return fc, nil +} + +func (ec *executionContext) _Mutation_persistK8sSources(ctx context.Context, field graphql.CollectedField) (ret graphql.Marshaler) { + fc, err := ec.fieldContext_Mutation_persistK8sSources(ctx, field) + if err != nil { + return graphql.Null + } + ctx = graphql.WithFieldContext(ctx, fc) + defer func() { + if r := recover(); r != nil { + ec.Error(ctx, ec.Recover(ctx, r)) + ret = graphql.Null + } + }() + resTmp, err := ec.ResolverMiddleware(ctx, func(rctx context.Context) (interface{}, error) { + ctx = rctx // use context from middleware stack in children + return ec.resolvers.Mutation().PersistK8sSources(rctx, fc.Args["namespace"].(string), fc.Args["sources"].([]*model.PersistNamespaceSourceInput)) + }) + if err != nil { + ec.Error(ctx, err) + return graphql.Null + } + if resTmp == nil { + if !graphql.HasFieldError(ctx, fc) { + ec.Errorf(ctx, "must not be null") + } + return graphql.Null + } + res := resTmp.(bool) + fc.Result = res + return ec.marshalNBoolean2bool(ctx, field.Selections, res) +} + +func (ec *executionContext) fieldContext_Mutation_persistK8sSources(ctx context.Context, field graphql.CollectedField) (fc *graphql.FieldContext, err error) { + fc = &graphql.FieldContext{ + Object: "Mutation", + Field: field, + IsMethod: true, + IsResolver: true, + Child: func(ctx context.Context, field graphql.CollectedField) (*graphql.FieldContext, error) { + return nil, errors.New("field of type Boolean does not have child fields") + }, + } + defer func() { + if r := recover(); r != nil { + err = ec.Recover(ctx, r) + ec.Error(ctx, err) + } + }() + ctx = graphql.WithFieldContext(ctx, fc) + if fc.Args, err = ec.field_Mutation_persistK8sSources_args(ctx, field.ArgumentMap(ec.Variables)); err != nil { + ec.Error(ctx, err) + return fc, err + } + return fc, nil +} + +func (ec *executionContext) _Mutation_testConnectionForDestination(ctx context.Context, field graphql.CollectedField) (ret graphql.Marshaler) { + fc, err := ec.fieldContext_Mutation_testConnectionForDestination(ctx, field) + if err != nil { + return graphql.Null + } + ctx = graphql.WithFieldContext(ctx, fc) + defer func() { + if r := recover(); r != nil { + ec.Error(ctx, ec.Recover(ctx, r)) + ret = graphql.Null + } + }() + resTmp, err := ec.ResolverMiddleware(ctx, func(rctx context.Context) (interface{}, error) { + ctx = rctx // use context from middleware stack in children + return ec.resolvers.Mutation().TestConnectionForDestination(rctx, fc.Args["destination"].(model.DestinationInput)) + }) + if err != nil { + ec.Error(ctx, err) + return graphql.Null + } + if resTmp == nil { + if !graphql.HasFieldError(ctx, fc) { + ec.Errorf(ctx, "must not be null") + } + return graphql.Null + } + res := resTmp.(*model.TestConnectionResponse) + fc.Result = res + return ec.marshalNTestConnectionResponse2ᚖgithubᚗcomᚋodigosᚑioᚋodigosᚋfrontendᚋgraphᚋmodelᚐTestConnectionResponse(ctx, field.Selections, res) +} + +func (ec *executionContext) fieldContext_Mutation_testConnectionForDestination(ctx context.Context, field graphql.CollectedField) (fc *graphql.FieldContext, err error) { + fc = &graphql.FieldContext{ + Object: "Mutation", + Field: field, + IsMethod: true, + IsResolver: true, + Child: func(ctx context.Context, field graphql.CollectedField) (*graphql.FieldContext, error) { + switch field.Name { + case "succeeded": + return ec.fieldContext_TestConnectionResponse_succeeded(ctx, field) + case "statusCode": + return ec.fieldContext_TestConnectionResponse_statusCode(ctx, field) + case "destinationType": + return ec.fieldContext_TestConnectionResponse_destinationType(ctx, field) + case "message": + return ec.fieldContext_TestConnectionResponse_message(ctx, field) + case "reason": + return ec.fieldContext_TestConnectionResponse_reason(ctx, field) + } + return nil, fmt.Errorf("no field named %q was found under type TestConnectionResponse", field.Name) + }, + } + defer func() { + if r := recover(); r != nil { + err = ec.Recover(ctx, r) + ec.Error(ctx, err) + } + }() + ctx = graphql.WithFieldContext(ctx, fc) + if fc.Args, err = ec.field_Mutation_testConnectionForDestination_args(ctx, field.ArgumentMap(ec.Variables)); err != nil { + ec.Error(ctx, err) + return fc, err + } + return fc, nil +} + +func (ec *executionContext) _Mutation_updateK8sActualSource(ctx context.Context, field graphql.CollectedField) (ret graphql.Marshaler) { + fc, err := ec.fieldContext_Mutation_updateK8sActualSource(ctx, field) + if err != nil { + return graphql.Null + } + ctx = graphql.WithFieldContext(ctx, fc) + defer func() { + if r := recover(); r != nil { + ec.Error(ctx, ec.Recover(ctx, r)) + ret = graphql.Null + } + }() + resTmp, err := ec.ResolverMiddleware(ctx, func(rctx context.Context) (interface{}, error) { + ctx = rctx // use context from middleware stack in children + return ec.resolvers.Mutation().UpdateK8sActualSource(rctx, fc.Args["sourceId"].(model.K8sSourceID), fc.Args["patchSourceRequest"].(model.PatchSourceRequestInput)) + }) + if err != nil { + ec.Error(ctx, err) + return graphql.Null + } + if resTmp == nil { + if !graphql.HasFieldError(ctx, fc) { + ec.Errorf(ctx, "must not be null") + } + return graphql.Null + } + res := resTmp.(bool) + fc.Result = res + return ec.marshalNBoolean2bool(ctx, field.Selections, res) +} + +func (ec *executionContext) fieldContext_Mutation_updateK8sActualSource(ctx context.Context, field graphql.CollectedField) (fc *graphql.FieldContext, err error) { + fc = &graphql.FieldContext{ + Object: "Mutation", + Field: field, + IsMethod: true, + IsResolver: true, + Child: func(ctx context.Context, field graphql.CollectedField) (*graphql.FieldContext, error) { + return nil, errors.New("field of type Boolean does not have child fields") + }, + } + defer func() { + if r := recover(); r != nil { + err = ec.Recover(ctx, r) + ec.Error(ctx, err) + } + }() + ctx = graphql.WithFieldContext(ctx, fc) + if fc.Args, err = ec.field_Mutation_updateK8sActualSource_args(ctx, field.ArgumentMap(ec.Variables)); err != nil { + ec.Error(ctx, err) + return fc, err + } + return fc, nil +} + +func (ec *executionContext) _Mutation_updateDestination(ctx context.Context, field graphql.CollectedField) (ret graphql.Marshaler) { + fc, err := ec.fieldContext_Mutation_updateDestination(ctx, field) + if err != nil { + return graphql.Null + } + ctx = graphql.WithFieldContext(ctx, fc) + defer func() { + if r := recover(); r != nil { + ec.Error(ctx, ec.Recover(ctx, r)) + ret = graphql.Null + } + }() + resTmp, err := ec.ResolverMiddleware(ctx, func(rctx context.Context) (interface{}, error) { + ctx = rctx // use context from middleware stack in children + return ec.resolvers.Mutation().UpdateDestination(rctx, fc.Args["id"].(string), fc.Args["destination"].(model.DestinationInput)) + }) + if err != nil { + ec.Error(ctx, err) + return graphql.Null + } + if resTmp == nil { + if !graphql.HasFieldError(ctx, fc) { + ec.Errorf(ctx, "must not be null") + } + return graphql.Null + } + res := resTmp.(*model.Destination) + fc.Result = res + return ec.marshalNDestination2ᚖgithubᚗcomᚋodigosᚑioᚋodigosᚋfrontendᚋgraphᚋmodelᚐDestination(ctx, field.Selections, res) +} + +func (ec *executionContext) fieldContext_Mutation_updateDestination(ctx context.Context, field graphql.CollectedField) (fc *graphql.FieldContext, err error) { + fc = &graphql.FieldContext{ + Object: "Mutation", + Field: field, + IsMethod: true, + IsResolver: true, + Child: func(ctx context.Context, field graphql.CollectedField) (*graphql.FieldContext, error) { + switch field.Name { + case "id": + return ec.fieldContext_Destination_id(ctx, field) + case "name": + return ec.fieldContext_Destination_name(ctx, field) + case "type": + return ec.fieldContext_Destination_type(ctx, field) + case "exportedSignals": + return ec.fieldContext_Destination_exportedSignals(ctx, field) + case "fields": + return ec.fieldContext_Destination_fields(ctx, field) + case "destinationType": + return ec.fieldContext_Destination_destinationType(ctx, field) + case "conditions": + return ec.fieldContext_Destination_conditions(ctx, field) + } + return nil, fmt.Errorf("no field named %q was found under type Destination", field.Name) + }, + } + defer func() { + if r := recover(); r != nil { + err = ec.Recover(ctx, r) + ec.Error(ctx, err) + } + }() + ctx = graphql.WithFieldContext(ctx, fc) + if fc.Args, err = ec.field_Mutation_updateDestination_args(ctx, field.ArgumentMap(ec.Variables)); err != nil { + ec.Error(ctx, err) + return fc, err + } + return fc, nil +} + +func (ec *executionContext) _ObservabilitySignalSupport_supported(ctx context.Context, field graphql.CollectedField, obj *model.ObservabilitySignalSupport) (ret graphql.Marshaler) { + fc, err := ec.fieldContext_ObservabilitySignalSupport_supported(ctx, field) + if err != nil { + return graphql.Null + } + ctx = graphql.WithFieldContext(ctx, fc) + defer func() { + if r := recover(); r != nil { + ec.Error(ctx, ec.Recover(ctx, r)) + ret = graphql.Null + } + }() + resTmp, err := ec.ResolverMiddleware(ctx, func(rctx context.Context) (interface{}, error) { + ctx = rctx // use context from middleware stack in children + return obj.Supported, nil + }) + if err != nil { + ec.Error(ctx, err) + return graphql.Null + } + if resTmp == nil { + if !graphql.HasFieldError(ctx, fc) { + ec.Errorf(ctx, "must not be null") + } + return graphql.Null + } + res := resTmp.(bool) + fc.Result = res + return ec.marshalNBoolean2bool(ctx, field.Selections, res) +} + +func (ec *executionContext) fieldContext_ObservabilitySignalSupport_supported(_ context.Context, field graphql.CollectedField) (fc *graphql.FieldContext, err error) { + fc = &graphql.FieldContext{ + Object: "ObservabilitySignalSupport", + Field: field, + IsMethod: false, + IsResolver: false, + Child: func(ctx context.Context, field graphql.CollectedField) (*graphql.FieldContext, error) { + return nil, errors.New("field of type Boolean does not have child fields") + }, + } + return fc, nil +} + +func (ec *executionContext) _Query_computePlatform(ctx context.Context, field graphql.CollectedField) (ret graphql.Marshaler) { + fc, err := ec.fieldContext_Query_computePlatform(ctx, field) + if err != nil { + return graphql.Null + } + ctx = graphql.WithFieldContext(ctx, fc) + defer func() { + if r := recover(); r != nil { + ec.Error(ctx, ec.Recover(ctx, r)) + ret = graphql.Null + } + }() + resTmp, err := ec.ResolverMiddleware(ctx, func(rctx context.Context) (interface{}, error) { + ctx = rctx // use context from middleware stack in children + return ec.resolvers.Query().ComputePlatform(rctx) + }) + if err != nil { + ec.Error(ctx, err) + return graphql.Null + } + if resTmp == nil { + return graphql.Null + } + res := resTmp.(*model.ComputePlatform) + fc.Result = res + return ec.marshalOComputePlatform2ᚖgithubᚗcomᚋodigosᚑioᚋodigosᚋfrontendᚋgraphᚋmodelᚐComputePlatform(ctx, field.Selections, res) +} + +func (ec *executionContext) fieldContext_Query_computePlatform(_ context.Context, field graphql.CollectedField) (fc *graphql.FieldContext, err error) { + fc = &graphql.FieldContext{ + Object: "Query", + Field: field, + IsMethod: true, + IsResolver: true, + Child: func(ctx context.Context, field graphql.CollectedField) (*graphql.FieldContext, error) { + switch field.Name { + case "computePlatformType": + return ec.fieldContext_ComputePlatform_computePlatformType(ctx, field) + case "k8sActualNamespace": + return ec.fieldContext_ComputePlatform_k8sActualNamespace(ctx, field) + case "k8sActualNamespaces": + return ec.fieldContext_ComputePlatform_k8sActualNamespaces(ctx, field) + case "k8sActualSource": + return ec.fieldContext_ComputePlatform_k8sActualSource(ctx, field) + case "k8sActualSources": + return ec.fieldContext_ComputePlatform_k8sActualSources(ctx, field) + case "destinations": + return ec.fieldContext_ComputePlatform_destinations(ctx, field) + case "actions": + return ec.fieldContext_ComputePlatform_actions(ctx, field) + } + return nil, fmt.Errorf("no field named %q was found under type ComputePlatform", field.Name) + }, + } + return fc, nil +} + +func (ec *executionContext) _Query_config(ctx context.Context, field graphql.CollectedField) (ret graphql.Marshaler) { + fc, err := ec.fieldContext_Query_config(ctx, field) + if err != nil { + return graphql.Null + } + ctx = graphql.WithFieldContext(ctx, fc) + defer func() { + if r := recover(); r != nil { + ec.Error(ctx, ec.Recover(ctx, r)) + ret = graphql.Null + } + }() + resTmp, err := ec.ResolverMiddleware(ctx, func(rctx context.Context) (interface{}, error) { + ctx = rctx // use context from middleware stack in children + return ec.resolvers.Query().Config(rctx) + }) + if err != nil { + ec.Error(ctx, err) + return graphql.Null + } + if resTmp == nil { + return graphql.Null + } + res := resTmp.(*model.GetConfigResponse) + fc.Result = res + return ec.marshalOGetConfigResponse2ᚖgithubᚗcomᚋodigosᚑioᚋodigosᚋfrontendᚋgraphᚋmodelᚐGetConfigResponse(ctx, field.Selections, res) +} + +func (ec *executionContext) fieldContext_Query_config(_ context.Context, field graphql.CollectedField) (fc *graphql.FieldContext, err error) { + fc = &graphql.FieldContext{ + Object: "Query", + Field: field, + IsMethod: true, + IsResolver: true, + Child: func(ctx context.Context, field graphql.CollectedField) (*graphql.FieldContext, error) { + switch field.Name { + case "installation": + return ec.fieldContext_GetConfigResponse_installation(ctx, field) + } + return nil, fmt.Errorf("no field named %q was found under type GetConfigResponse", field.Name) + }, + } + return fc, nil +} + +func (ec *executionContext) _Query_destinationTypes(ctx context.Context, field graphql.CollectedField) (ret graphql.Marshaler) { + fc, err := ec.fieldContext_Query_destinationTypes(ctx, field) + if err != nil { + return graphql.Null + } + ctx = graphql.WithFieldContext(ctx, fc) + defer func() { + if r := recover(); r != nil { + ec.Error(ctx, ec.Recover(ctx, r)) + ret = graphql.Null + } + }() + resTmp, err := ec.ResolverMiddleware(ctx, func(rctx context.Context) (interface{}, error) { + ctx = rctx // use context from middleware stack in children + return ec.resolvers.Query().DestinationTypes(rctx) + }) + if err != nil { + ec.Error(ctx, err) + return graphql.Null + } + if resTmp == nil { + return graphql.Null + } + res := resTmp.(*model.GetDestinationTypesResponse) + fc.Result = res + return ec.marshalOGetDestinationTypesResponse2ᚖgithubᚗcomᚋodigosᚑioᚋodigosᚋfrontendᚋgraphᚋmodelᚐGetDestinationTypesResponse(ctx, field.Selections, res) +} + +func (ec *executionContext) fieldContext_Query_destinationTypes(_ context.Context, field graphql.CollectedField) (fc *graphql.FieldContext, err error) { + fc = &graphql.FieldContext{ + Object: "Query", + Field: field, + IsMethod: true, + IsResolver: true, + Child: func(ctx context.Context, field graphql.CollectedField) (*graphql.FieldContext, error) { + switch field.Name { + case "categories": + return ec.fieldContext_GetDestinationTypesResponse_categories(ctx, field) + } + return nil, fmt.Errorf("no field named %q was found under type GetDestinationTypesResponse", field.Name) + }, + } + return fc, nil +} + +func (ec *executionContext) _Query_destinationTypeDetails(ctx context.Context, field graphql.CollectedField) (ret graphql.Marshaler) { + fc, err := ec.fieldContext_Query_destinationTypeDetails(ctx, field) + if err != nil { + return graphql.Null + } + ctx = graphql.WithFieldContext(ctx, fc) + defer func() { + if r := recover(); r != nil { + ec.Error(ctx, ec.Recover(ctx, r)) + ret = graphql.Null + } + }() + resTmp, err := ec.ResolverMiddleware(ctx, func(rctx context.Context) (interface{}, error) { + ctx = rctx // use context from middleware stack in children + return ec.resolvers.Query().DestinationTypeDetails(rctx, fc.Args["type"].(string)) + }) + if err != nil { + ec.Error(ctx, err) + return graphql.Null + } + if resTmp == nil { + return graphql.Null + } + res := resTmp.(*model.GetDestinationDetailsResponse) + fc.Result = res + return ec.marshalOGetDestinationDetailsResponse2ᚖgithubᚗcomᚋodigosᚑioᚋodigosᚋfrontendᚋgraphᚋmodelᚐGetDestinationDetailsResponse(ctx, field.Selections, res) +} + +func (ec *executionContext) fieldContext_Query_destinationTypeDetails(ctx context.Context, field graphql.CollectedField) (fc *graphql.FieldContext, err error) { + fc = &graphql.FieldContext{ + Object: "Query", + Field: field, + IsMethod: true, + IsResolver: true, + Child: func(ctx context.Context, field graphql.CollectedField) (*graphql.FieldContext, error) { + switch field.Name { + case "fields": + return ec.fieldContext_GetDestinationDetailsResponse_fields(ctx, field) + } + return nil, fmt.Errorf("no field named %q was found under type GetDestinationDetailsResponse", field.Name) + }, + } + defer func() { + if r := recover(); r != nil { + err = ec.Recover(ctx, r) + ec.Error(ctx, err) + } + }() + ctx = graphql.WithFieldContext(ctx, fc) + if fc.Args, err = ec.field_Query_destinationTypeDetails_args(ctx, field.ArgumentMap(ec.Variables)); err != nil { + ec.Error(ctx, err) + return fc, err + } + return fc, nil +} + +func (ec *executionContext) _Query_potentialDestinations(ctx context.Context, field graphql.CollectedField) (ret graphql.Marshaler) { + fc, err := ec.fieldContext_Query_potentialDestinations(ctx, field) + if err != nil { + return graphql.Null + } + ctx = graphql.WithFieldContext(ctx, fc) + defer func() { + if r := recover(); r != nil { + ec.Error(ctx, ec.Recover(ctx, r)) + ret = graphql.Null + } + }() + resTmp, err := ec.ResolverMiddleware(ctx, func(rctx context.Context) (interface{}, error) { + ctx = rctx // use context from middleware stack in children + return ec.resolvers.Query().PotentialDestinations(rctx) + }) + if err != nil { + ec.Error(ctx, err) + return graphql.Null + } + if resTmp == nil { + if !graphql.HasFieldError(ctx, fc) { + ec.Errorf(ctx, "must not be null") + } + return graphql.Null + } + res := resTmp.([]*model.DestinationDetails) + fc.Result = res + return ec.marshalNDestinationDetails2ᚕᚖgithubᚗcomᚋodigosᚑioᚋodigosᚋfrontendᚋgraphᚋmodelᚐDestinationDetailsᚄ(ctx, field.Selections, res) +} + +func (ec *executionContext) fieldContext_Query_potentialDestinations(_ context.Context, field graphql.CollectedField) (fc *graphql.FieldContext, err error) { + fc = &graphql.FieldContext{ + Object: "Query", + Field: field, + IsMethod: true, + IsResolver: true, + Child: func(ctx context.Context, field graphql.CollectedField) (*graphql.FieldContext, error) { + switch field.Name { + case "type": + return ec.fieldContext_DestinationDetails_type(ctx, field) + case "urlString": + return ec.fieldContext_DestinationDetails_urlString(ctx, field) + case "fields": + return ec.fieldContext_DestinationDetails_fields(ctx, field) + } + return nil, fmt.Errorf("no field named %q was found under type DestinationDetails", field.Name) + }, + } + return fc, nil +} + +func (ec *executionContext) _Query___type(ctx context.Context, field graphql.CollectedField) (ret graphql.Marshaler) { + fc, err := ec.fieldContext_Query___type(ctx, field) + if err != nil { + return graphql.Null + } + ctx = graphql.WithFieldContext(ctx, fc) + defer func() { + if r := recover(); r != nil { + ec.Error(ctx, ec.Recover(ctx, r)) + ret = graphql.Null + } + }() + resTmp, err := ec.ResolverMiddleware(ctx, func(rctx context.Context) (interface{}, error) { + ctx = rctx // use context from middleware stack in children + return ec.introspectType(fc.Args["name"].(string)) + }) + if err != nil { + ec.Error(ctx, err) + return graphql.Null + } + if resTmp == nil { + return graphql.Null + } + res := resTmp.(*introspection.Type) + fc.Result = res + return ec.marshalO__Type2ᚖgithubᚗcomᚋ99designsᚋgqlgenᚋgraphqlᚋintrospectionᚐType(ctx, field.Selections, res) +} + +func (ec *executionContext) fieldContext_Query___type(ctx context.Context, field graphql.CollectedField) (fc *graphql.FieldContext, err error) { + fc = &graphql.FieldContext{ + Object: "Query", + Field: field, + IsMethod: true, + IsResolver: false, + Child: func(ctx context.Context, field graphql.CollectedField) (*graphql.FieldContext, error) { + switch field.Name { + case "kind": + return ec.fieldContext___Type_kind(ctx, field) + case "name": + return ec.fieldContext___Type_name(ctx, field) + case "description": + return ec.fieldContext___Type_description(ctx, field) + case "fields": + return ec.fieldContext___Type_fields(ctx, field) + case "interfaces": + return ec.fieldContext___Type_interfaces(ctx, field) + case "possibleTypes": + return ec.fieldContext___Type_possibleTypes(ctx, field) + case "enumValues": + return ec.fieldContext___Type_enumValues(ctx, field) + case "inputFields": + return ec.fieldContext___Type_inputFields(ctx, field) + case "ofType": + return ec.fieldContext___Type_ofType(ctx, field) + case "specifiedByURL": + return ec.fieldContext___Type_specifiedByURL(ctx, field) + } + return nil, fmt.Errorf("no field named %q was found under type __Type", field.Name) + }, + } + defer func() { + if r := recover(); r != nil { + err = ec.Recover(ctx, r) + ec.Error(ctx, err) + } + }() + ctx = graphql.WithFieldContext(ctx, fc) + if fc.Args, err = ec.field_Query___type_args(ctx, field.ArgumentMap(ec.Variables)); err != nil { + ec.Error(ctx, err) + return fc, err + } + return fc, nil +} + +func (ec *executionContext) _Query___schema(ctx context.Context, field graphql.CollectedField) (ret graphql.Marshaler) { + fc, err := ec.fieldContext_Query___schema(ctx, field) + if err != nil { + return graphql.Null + } + ctx = graphql.WithFieldContext(ctx, fc) + defer func() { + if r := recover(); r != nil { + ec.Error(ctx, ec.Recover(ctx, r)) + ret = graphql.Null + } + }() + resTmp, err := ec.ResolverMiddleware(ctx, func(rctx context.Context) (interface{}, error) { + ctx = rctx // use context from middleware stack in children + return ec.introspectSchema() + }) + if err != nil { + ec.Error(ctx, err) + return graphql.Null + } + if resTmp == nil { + return graphql.Null + } + res := resTmp.(*introspection.Schema) + fc.Result = res + return ec.marshalO__Schema2ᚖgithubᚗcomᚋ99designsᚋgqlgenᚋgraphqlᚋintrospectionᚐSchema(ctx, field.Selections, res) +} + +func (ec *executionContext) fieldContext_Query___schema(_ context.Context, field graphql.CollectedField) (fc *graphql.FieldContext, err error) { + fc = &graphql.FieldContext{ + Object: "Query", + Field: field, + IsMethod: true, + IsResolver: false, + Child: func(ctx context.Context, field graphql.CollectedField) (*graphql.FieldContext, error) { + switch field.Name { + case "description": + return ec.fieldContext___Schema_description(ctx, field) + case "types": + return ec.fieldContext___Schema_types(ctx, field) + case "queryType": + return ec.fieldContext___Schema_queryType(ctx, field) + case "mutationType": + return ec.fieldContext___Schema_mutationType(ctx, field) + case "subscriptionType": + return ec.fieldContext___Schema_subscriptionType(ctx, field) + case "directives": + return ec.fieldContext___Schema_directives(ctx, field) + } + return nil, fmt.Errorf("no field named %q was found under type __Schema", field.Name) + }, + } + return fc, nil +} + +func (ec *executionContext) _SourceContainerRuntimeDetails_containerName(ctx context.Context, field graphql.CollectedField, obj *model.SourceContainerRuntimeDetails) (ret graphql.Marshaler) { + fc, err := ec.fieldContext_SourceContainerRuntimeDetails_containerName(ctx, field) + if err != nil { + return graphql.Null + } + ctx = graphql.WithFieldContext(ctx, fc) + defer func() { + if r := recover(); r != nil { + ec.Error(ctx, ec.Recover(ctx, r)) + ret = graphql.Null + } + }() + resTmp, err := ec.ResolverMiddleware(ctx, func(rctx context.Context) (interface{}, error) { + ctx = rctx // use context from middleware stack in children + return obj.ContainerName, nil + }) + if err != nil { + ec.Error(ctx, err) + return graphql.Null + } + if resTmp == nil { + if !graphql.HasFieldError(ctx, fc) { + ec.Errorf(ctx, "must not be null") + } + return graphql.Null + } + res := resTmp.(string) + fc.Result = res + return ec.marshalNString2string(ctx, field.Selections, res) +} + +func (ec *executionContext) fieldContext_SourceContainerRuntimeDetails_containerName(_ context.Context, field graphql.CollectedField) (fc *graphql.FieldContext, err error) { + fc = &graphql.FieldContext{ + Object: "SourceContainerRuntimeDetails", + Field: field, + IsMethod: false, + IsResolver: false, + Child: func(ctx context.Context, field graphql.CollectedField) (*graphql.FieldContext, error) { + return nil, errors.New("field of type String does not have child fields") + }, + } + return fc, nil +} + +func (ec *executionContext) _SourceContainerRuntimeDetails_language(ctx context.Context, field graphql.CollectedField, obj *model.SourceContainerRuntimeDetails) (ret graphql.Marshaler) { + fc, err := ec.fieldContext_SourceContainerRuntimeDetails_language(ctx, field) + if err != nil { + return graphql.Null + } + ctx = graphql.WithFieldContext(ctx, fc) + defer func() { + if r := recover(); r != nil { + ec.Error(ctx, ec.Recover(ctx, r)) + ret = graphql.Null + } + }() + resTmp, err := ec.ResolverMiddleware(ctx, func(rctx context.Context) (interface{}, error) { + ctx = rctx // use context from middleware stack in children + return obj.Language, nil + }) + if err != nil { + ec.Error(ctx, err) + return graphql.Null + } + if resTmp == nil { + if !graphql.HasFieldError(ctx, fc) { + ec.Errorf(ctx, "must not be null") + } + return graphql.Null + } + res := resTmp.(string) + fc.Result = res + return ec.marshalNString2string(ctx, field.Selections, res) +} + +func (ec *executionContext) fieldContext_SourceContainerRuntimeDetails_language(_ context.Context, field graphql.CollectedField) (fc *graphql.FieldContext, err error) { + fc = &graphql.FieldContext{ + Object: "SourceContainerRuntimeDetails", + Field: field, + IsMethod: false, + IsResolver: false, + Child: func(ctx context.Context, field graphql.CollectedField) (*graphql.FieldContext, error) { + return nil, errors.New("field of type String does not have child fields") + }, + } + return fc, nil +} + +func (ec *executionContext) _SupportedSignals_traces(ctx context.Context, field graphql.CollectedField, obj *model.SupportedSignals) (ret graphql.Marshaler) { + fc, err := ec.fieldContext_SupportedSignals_traces(ctx, field) + if err != nil { + return graphql.Null + } + ctx = graphql.WithFieldContext(ctx, fc) + defer func() { + if r := recover(); r != nil { + ec.Error(ctx, ec.Recover(ctx, r)) + ret = graphql.Null + } + }() + resTmp, err := ec.ResolverMiddleware(ctx, func(rctx context.Context) (interface{}, error) { + ctx = rctx // use context from middleware stack in children + return obj.Traces, nil + }) + if err != nil { + ec.Error(ctx, err) + return graphql.Null + } + if resTmp == nil { + if !graphql.HasFieldError(ctx, fc) { + ec.Errorf(ctx, "must not be null") + } + return graphql.Null + } + res := resTmp.(model.ObservabilitySignalSupport) + fc.Result = res + return ec.marshalNObservabilitySignalSupport2githubᚗcomᚋodigosᚑioᚋodigosᚋfrontendᚋgraphᚋmodelᚐObservabilitySignalSupport(ctx, field.Selections, res) +} + +func (ec *executionContext) fieldContext_SupportedSignals_traces(_ context.Context, field graphql.CollectedField) (fc *graphql.FieldContext, err error) { + fc = &graphql.FieldContext{ + Object: "SupportedSignals", + Field: field, + IsMethod: false, + IsResolver: false, + Child: func(ctx context.Context, field graphql.CollectedField) (*graphql.FieldContext, error) { + switch field.Name { + case "supported": + return ec.fieldContext_ObservabilitySignalSupport_supported(ctx, field) + } + return nil, fmt.Errorf("no field named %q was found under type ObservabilitySignalSupport", field.Name) + }, + } + return fc, nil +} + +func (ec *executionContext) _SupportedSignals_metrics(ctx context.Context, field graphql.CollectedField, obj *model.SupportedSignals) (ret graphql.Marshaler) { + fc, err := ec.fieldContext_SupportedSignals_metrics(ctx, field) + if err != nil { + return graphql.Null + } + ctx = graphql.WithFieldContext(ctx, fc) + defer func() { + if r := recover(); r != nil { + ec.Error(ctx, ec.Recover(ctx, r)) + ret = graphql.Null + } + }() + resTmp, err := ec.ResolverMiddleware(ctx, func(rctx context.Context) (interface{}, error) { + ctx = rctx // use context from middleware stack in children + return obj.Metrics, nil + }) + if err != nil { + ec.Error(ctx, err) + return graphql.Null + } + if resTmp == nil { + if !graphql.HasFieldError(ctx, fc) { + ec.Errorf(ctx, "must not be null") + } + return graphql.Null + } + res := resTmp.(model.ObservabilitySignalSupport) + fc.Result = res + return ec.marshalNObservabilitySignalSupport2githubᚗcomᚋodigosᚑioᚋodigosᚋfrontendᚋgraphᚋmodelᚐObservabilitySignalSupport(ctx, field.Selections, res) +} + +func (ec *executionContext) fieldContext_SupportedSignals_metrics(_ context.Context, field graphql.CollectedField) (fc *graphql.FieldContext, err error) { + fc = &graphql.FieldContext{ + Object: "SupportedSignals", + Field: field, + IsMethod: false, + IsResolver: false, + Child: func(ctx context.Context, field graphql.CollectedField) (*graphql.FieldContext, error) { + switch field.Name { + case "supported": + return ec.fieldContext_ObservabilitySignalSupport_supported(ctx, field) + } + return nil, fmt.Errorf("no field named %q was found under type ObservabilitySignalSupport", field.Name) + }, + } + return fc, nil +} + +func (ec *executionContext) _SupportedSignals_logs(ctx context.Context, field graphql.CollectedField, obj *model.SupportedSignals) (ret graphql.Marshaler) { + fc, err := ec.fieldContext_SupportedSignals_logs(ctx, field) + if err != nil { + return graphql.Null + } + ctx = graphql.WithFieldContext(ctx, fc) + defer func() { + if r := recover(); r != nil { + ec.Error(ctx, ec.Recover(ctx, r)) + ret = graphql.Null + } + }() + resTmp, err := ec.ResolverMiddleware(ctx, func(rctx context.Context) (interface{}, error) { + ctx = rctx // use context from middleware stack in children + return obj.Logs, nil + }) + if err != nil { + ec.Error(ctx, err) + return graphql.Null + } + if resTmp == nil { + if !graphql.HasFieldError(ctx, fc) { + ec.Errorf(ctx, "must not be null") + } + return graphql.Null + } + res := resTmp.(model.ObservabilitySignalSupport) + fc.Result = res + return ec.marshalNObservabilitySignalSupport2githubᚗcomᚋodigosᚑioᚋodigosᚋfrontendᚋgraphᚋmodelᚐObservabilitySignalSupport(ctx, field.Selections, res) +} + +func (ec *executionContext) fieldContext_SupportedSignals_logs(_ context.Context, field graphql.CollectedField) (fc *graphql.FieldContext, err error) { + fc = &graphql.FieldContext{ + Object: "SupportedSignals", + Field: field, + IsMethod: false, + IsResolver: false, + Child: func(ctx context.Context, field graphql.CollectedField) (*graphql.FieldContext, error) { + switch field.Name { + case "supported": + return ec.fieldContext_ObservabilitySignalSupport_supported(ctx, field) + } + return nil, fmt.Errorf("no field named %q was found under type ObservabilitySignalSupport", field.Name) + }, + } + return fc, nil +} + +func (ec *executionContext) _TestConnectionResponse_succeeded(ctx context.Context, field graphql.CollectedField, obj *model.TestConnectionResponse) (ret graphql.Marshaler) { + fc, err := ec.fieldContext_TestConnectionResponse_succeeded(ctx, field) + if err != nil { + return graphql.Null + } + ctx = graphql.WithFieldContext(ctx, fc) + defer func() { + if r := recover(); r != nil { + ec.Error(ctx, ec.Recover(ctx, r)) + ret = graphql.Null + } + }() + resTmp, err := ec.ResolverMiddleware(ctx, func(rctx context.Context) (interface{}, error) { + ctx = rctx // use context from middleware stack in children + return obj.Succeeded, nil + }) + if err != nil { + ec.Error(ctx, err) + return graphql.Null + } + if resTmp == nil { + if !graphql.HasFieldError(ctx, fc) { + ec.Errorf(ctx, "must not be null") + } + return graphql.Null + } + res := resTmp.(bool) + fc.Result = res + return ec.marshalNBoolean2bool(ctx, field.Selections, res) +} + +func (ec *executionContext) fieldContext_TestConnectionResponse_succeeded(_ context.Context, field graphql.CollectedField) (fc *graphql.FieldContext, err error) { + fc = &graphql.FieldContext{ + Object: "TestConnectionResponse", + Field: field, + IsMethod: false, + IsResolver: false, + Child: func(ctx context.Context, field graphql.CollectedField) (*graphql.FieldContext, error) { + return nil, errors.New("field of type Boolean does not have child fields") + }, + } + return fc, nil +} + +func (ec *executionContext) _TestConnectionResponse_statusCode(ctx context.Context, field graphql.CollectedField, obj *model.TestConnectionResponse) (ret graphql.Marshaler) { + fc, err := ec.fieldContext_TestConnectionResponse_statusCode(ctx, field) + if err != nil { + return graphql.Null + } + ctx = graphql.WithFieldContext(ctx, fc) + defer func() { + if r := recover(); r != nil { + ec.Error(ctx, ec.Recover(ctx, r)) + ret = graphql.Null + } + }() + resTmp, err := ec.ResolverMiddleware(ctx, func(rctx context.Context) (interface{}, error) { + ctx = rctx // use context from middleware stack in children + return obj.StatusCode, nil + }) + if err != nil { + ec.Error(ctx, err) + return graphql.Null + } + if resTmp == nil { + if !graphql.HasFieldError(ctx, fc) { + ec.Errorf(ctx, "must not be null") + } + return graphql.Null + } + res := resTmp.(int) + fc.Result = res + return ec.marshalNInt2int(ctx, field.Selections, res) +} + +func (ec *executionContext) fieldContext_TestConnectionResponse_statusCode(_ context.Context, field graphql.CollectedField) (fc *graphql.FieldContext, err error) { + fc = &graphql.FieldContext{ + Object: "TestConnectionResponse", + Field: field, + IsMethod: false, + IsResolver: false, + Child: func(ctx context.Context, field graphql.CollectedField) (*graphql.FieldContext, error) { + return nil, errors.New("field of type Int does not have child fields") + }, + } + return fc, nil +} + +func (ec *executionContext) _TestConnectionResponse_destinationType(ctx context.Context, field graphql.CollectedField, obj *model.TestConnectionResponse) (ret graphql.Marshaler) { + fc, err := ec.fieldContext_TestConnectionResponse_destinationType(ctx, field) + if err != nil { + return graphql.Null + } + ctx = graphql.WithFieldContext(ctx, fc) + defer func() { + if r := recover(); r != nil { + ec.Error(ctx, ec.Recover(ctx, r)) + ret = graphql.Null + } + }() + resTmp, err := ec.ResolverMiddleware(ctx, func(rctx context.Context) (interface{}, error) { + ctx = rctx // use context from middleware stack in children + return obj.DestinationType, nil + }) + if err != nil { + ec.Error(ctx, err) + return graphql.Null + } + if resTmp == nil { + return graphql.Null + } + res := resTmp.(*string) + fc.Result = res + return ec.marshalOString2ᚖstring(ctx, field.Selections, res) +} + +func (ec *executionContext) fieldContext_TestConnectionResponse_destinationType(_ context.Context, field graphql.CollectedField) (fc *graphql.FieldContext, err error) { + fc = &graphql.FieldContext{ + Object: "TestConnectionResponse", + Field: field, + IsMethod: false, + IsResolver: false, + Child: func(ctx context.Context, field graphql.CollectedField) (*graphql.FieldContext, error) { + return nil, errors.New("field of type String does not have child fields") + }, + } + return fc, nil +} + +func (ec *executionContext) _TestConnectionResponse_message(ctx context.Context, field graphql.CollectedField, obj *model.TestConnectionResponse) (ret graphql.Marshaler) { + fc, err := ec.fieldContext_TestConnectionResponse_message(ctx, field) + if err != nil { + return graphql.Null + } + ctx = graphql.WithFieldContext(ctx, fc) + defer func() { + if r := recover(); r != nil { + ec.Error(ctx, ec.Recover(ctx, r)) + ret = graphql.Null + } + }() + resTmp, err := ec.ResolverMiddleware(ctx, func(rctx context.Context) (interface{}, error) { + ctx = rctx // use context from middleware stack in children + return obj.Message, nil + }) + if err != nil { + ec.Error(ctx, err) + return graphql.Null + } + if resTmp == nil { + return graphql.Null + } + res := resTmp.(*string) + fc.Result = res + return ec.marshalOString2ᚖstring(ctx, field.Selections, res) +} + +func (ec *executionContext) fieldContext_TestConnectionResponse_message(_ context.Context, field graphql.CollectedField) (fc *graphql.FieldContext, err error) { + fc = &graphql.FieldContext{ + Object: "TestConnectionResponse", + Field: field, + IsMethod: false, + IsResolver: false, + Child: func(ctx context.Context, field graphql.CollectedField) (*graphql.FieldContext, error) { + return nil, errors.New("field of type String does not have child fields") + }, + } + return fc, nil +} + +func (ec *executionContext) _TestConnectionResponse_reason(ctx context.Context, field graphql.CollectedField, obj *model.TestConnectionResponse) (ret graphql.Marshaler) { + fc, err := ec.fieldContext_TestConnectionResponse_reason(ctx, field) + if err != nil { + return graphql.Null + } + ctx = graphql.WithFieldContext(ctx, fc) + defer func() { + if r := recover(); r != nil { + ec.Error(ctx, ec.Recover(ctx, r)) + ret = graphql.Null + } + }() + resTmp, err := ec.ResolverMiddleware(ctx, func(rctx context.Context) (interface{}, error) { + ctx = rctx // use context from middleware stack in children + return obj.Reason, nil + }) + if err != nil { + ec.Error(ctx, err) + return graphql.Null + } + if resTmp == nil { + return graphql.Null + } + res := resTmp.(*string) + fc.Result = res + return ec.marshalOString2ᚖstring(ctx, field.Selections, res) +} + +func (ec *executionContext) fieldContext_TestConnectionResponse_reason(_ context.Context, field graphql.CollectedField) (fc *graphql.FieldContext, err error) { + fc = &graphql.FieldContext{ + Object: "TestConnectionResponse", + Field: field, + IsMethod: false, + IsResolver: false, + Child: func(ctx context.Context, field graphql.CollectedField) (*graphql.FieldContext, error) { + return nil, errors.New("field of type String does not have child fields") + }, + } + return fc, nil +} + +func (ec *executionContext) ___Directive_name(ctx context.Context, field graphql.CollectedField, obj *introspection.Directive) (ret graphql.Marshaler) { + fc, err := ec.fieldContext___Directive_name(ctx, field) + if err != nil { + return graphql.Null + } + ctx = graphql.WithFieldContext(ctx, fc) + defer func() { + if r := recover(); r != nil { + ec.Error(ctx, ec.Recover(ctx, r)) + ret = graphql.Null + } + }() + resTmp, err := ec.ResolverMiddleware(ctx, func(rctx context.Context) (interface{}, error) { + ctx = rctx // use context from middleware stack in children + return obj.Name, nil + }) + if err != nil { + ec.Error(ctx, err) + return graphql.Null + } + if resTmp == nil { + if !graphql.HasFieldError(ctx, fc) { + ec.Errorf(ctx, "must not be null") + } + return graphql.Null + } + res := resTmp.(string) + fc.Result = res + return ec.marshalNString2string(ctx, field.Selections, res) +} + +func (ec *executionContext) fieldContext___Directive_name(_ context.Context, field graphql.CollectedField) (fc *graphql.FieldContext, err error) { + fc = &graphql.FieldContext{ + Object: "__Directive", + Field: field, + IsMethod: false, + IsResolver: false, + Child: func(ctx context.Context, field graphql.CollectedField) (*graphql.FieldContext, error) { + return nil, errors.New("field of type String does not have child fields") + }, + } + return fc, nil +} + +func (ec *executionContext) ___Directive_description(ctx context.Context, field graphql.CollectedField, obj *introspection.Directive) (ret graphql.Marshaler) { + fc, err := ec.fieldContext___Directive_description(ctx, field) + if err != nil { + return graphql.Null + } + ctx = graphql.WithFieldContext(ctx, fc) + defer func() { + if r := recover(); r != nil { + ec.Error(ctx, ec.Recover(ctx, r)) + ret = graphql.Null + } + }() + resTmp, err := ec.ResolverMiddleware(ctx, func(rctx context.Context) (interface{}, error) { + ctx = rctx // use context from middleware stack in children + return obj.Description(), nil + }) + if err != nil { + ec.Error(ctx, err) + return graphql.Null + } + if resTmp == nil { + return graphql.Null + } + res := resTmp.(*string) + fc.Result = res + return ec.marshalOString2ᚖstring(ctx, field.Selections, res) +} + +func (ec *executionContext) fieldContext___Directive_description(_ context.Context, field graphql.CollectedField) (fc *graphql.FieldContext, err error) { + fc = &graphql.FieldContext{ + Object: "__Directive", + Field: field, + IsMethod: true, + IsResolver: false, + Child: func(ctx context.Context, field graphql.CollectedField) (*graphql.FieldContext, error) { + return nil, errors.New("field of type String does not have child fields") + }, + } + return fc, nil +} + +func (ec *executionContext) ___Directive_locations(ctx context.Context, field graphql.CollectedField, obj *introspection.Directive) (ret graphql.Marshaler) { + fc, err := ec.fieldContext___Directive_locations(ctx, field) + if err != nil { + return graphql.Null + } + ctx = graphql.WithFieldContext(ctx, fc) + defer func() { + if r := recover(); r != nil { + ec.Error(ctx, ec.Recover(ctx, r)) + ret = graphql.Null + } + }() + resTmp, err := ec.ResolverMiddleware(ctx, func(rctx context.Context) (interface{}, error) { + ctx = rctx // use context from middleware stack in children + return obj.Locations, nil + }) + if err != nil { + ec.Error(ctx, err) + return graphql.Null + } + if resTmp == nil { + if !graphql.HasFieldError(ctx, fc) { + ec.Errorf(ctx, "must not be null") + } + return graphql.Null + } + res := resTmp.([]string) + fc.Result = res + return ec.marshalN__DirectiveLocation2ᚕstringᚄ(ctx, field.Selections, res) +} + +func (ec *executionContext) fieldContext___Directive_locations(_ context.Context, field graphql.CollectedField) (fc *graphql.FieldContext, err error) { + fc = &graphql.FieldContext{ + Object: "__Directive", + Field: field, + IsMethod: false, + IsResolver: false, + Child: func(ctx context.Context, field graphql.CollectedField) (*graphql.FieldContext, error) { + return nil, errors.New("field of type __DirectiveLocation does not have child fields") + }, + } + return fc, nil +} + +func (ec *executionContext) ___Directive_args(ctx context.Context, field graphql.CollectedField, obj *introspection.Directive) (ret graphql.Marshaler) { + fc, err := ec.fieldContext___Directive_args(ctx, field) + if err != nil { + return graphql.Null + } + ctx = graphql.WithFieldContext(ctx, fc) + defer func() { + if r := recover(); r != nil { + ec.Error(ctx, ec.Recover(ctx, r)) + ret = graphql.Null + } + }() + resTmp, err := ec.ResolverMiddleware(ctx, func(rctx context.Context) (interface{}, error) { + ctx = rctx // use context from middleware stack in children + return obj.Args, nil + }) + if err != nil { + ec.Error(ctx, err) + return graphql.Null + } + if resTmp == nil { + if !graphql.HasFieldError(ctx, fc) { + ec.Errorf(ctx, "must not be null") + } + return graphql.Null + } + res := resTmp.([]introspection.InputValue) + fc.Result = res + return ec.marshalN__InputValue2ᚕgithubᚗcomᚋ99designsᚋgqlgenᚋgraphqlᚋintrospectionᚐInputValueᚄ(ctx, field.Selections, res) +} + +func (ec *executionContext) fieldContext___Directive_args(_ context.Context, field graphql.CollectedField) (fc *graphql.FieldContext, err error) { + fc = &graphql.FieldContext{ + Object: "__Directive", + Field: field, + IsMethod: false, + IsResolver: false, + Child: func(ctx context.Context, field graphql.CollectedField) (*graphql.FieldContext, error) { + switch field.Name { + case "name": + return ec.fieldContext___InputValue_name(ctx, field) + case "description": + return ec.fieldContext___InputValue_description(ctx, field) + case "type": + return ec.fieldContext___InputValue_type(ctx, field) + case "defaultValue": + return ec.fieldContext___InputValue_defaultValue(ctx, field) + } + return nil, fmt.Errorf("no field named %q was found under type __InputValue", field.Name) + }, + } + return fc, nil +} + +func (ec *executionContext) ___Directive_isRepeatable(ctx context.Context, field graphql.CollectedField, obj *introspection.Directive) (ret graphql.Marshaler) { + fc, err := ec.fieldContext___Directive_isRepeatable(ctx, field) + if err != nil { + return graphql.Null + } + ctx = graphql.WithFieldContext(ctx, fc) + defer func() { + if r := recover(); r != nil { + ec.Error(ctx, ec.Recover(ctx, r)) + ret = graphql.Null + } + }() + resTmp, err := ec.ResolverMiddleware(ctx, func(rctx context.Context) (interface{}, error) { + ctx = rctx // use context from middleware stack in children + return obj.IsRepeatable, nil + }) + if err != nil { + ec.Error(ctx, err) + return graphql.Null + } + if resTmp == nil { + if !graphql.HasFieldError(ctx, fc) { + ec.Errorf(ctx, "must not be null") + } + return graphql.Null + } + res := resTmp.(bool) + fc.Result = res + return ec.marshalNBoolean2bool(ctx, field.Selections, res) +} + +func (ec *executionContext) fieldContext___Directive_isRepeatable(_ context.Context, field graphql.CollectedField) (fc *graphql.FieldContext, err error) { + fc = &graphql.FieldContext{ + Object: "__Directive", + Field: field, + IsMethod: false, + IsResolver: false, + Child: func(ctx context.Context, field graphql.CollectedField) (*graphql.FieldContext, error) { + return nil, errors.New("field of type Boolean does not have child fields") + }, + } + return fc, nil +} + +func (ec *executionContext) ___EnumValue_name(ctx context.Context, field graphql.CollectedField, obj *introspection.EnumValue) (ret graphql.Marshaler) { + fc, err := ec.fieldContext___EnumValue_name(ctx, field) + if err != nil { + return graphql.Null + } + ctx = graphql.WithFieldContext(ctx, fc) + defer func() { + if r := recover(); r != nil { + ec.Error(ctx, ec.Recover(ctx, r)) + ret = graphql.Null + } + }() + resTmp, err := ec.ResolverMiddleware(ctx, func(rctx context.Context) (interface{}, error) { + ctx = rctx // use context from middleware stack in children + return obj.Name, nil + }) + if err != nil { + ec.Error(ctx, err) + return graphql.Null + } + if resTmp == nil { + if !graphql.HasFieldError(ctx, fc) { + ec.Errorf(ctx, "must not be null") + } + return graphql.Null + } + res := resTmp.(string) + fc.Result = res + return ec.marshalNString2string(ctx, field.Selections, res) +} + +func (ec *executionContext) fieldContext___EnumValue_name(_ context.Context, field graphql.CollectedField) (fc *graphql.FieldContext, err error) { + fc = &graphql.FieldContext{ + Object: "__EnumValue", + Field: field, + IsMethod: false, + IsResolver: false, + Child: func(ctx context.Context, field graphql.CollectedField) (*graphql.FieldContext, error) { + return nil, errors.New("field of type String does not have child fields") + }, + } + return fc, nil +} + +func (ec *executionContext) ___EnumValue_description(ctx context.Context, field graphql.CollectedField, obj *introspection.EnumValue) (ret graphql.Marshaler) { + fc, err := ec.fieldContext___EnumValue_description(ctx, field) + if err != nil { + return graphql.Null + } + ctx = graphql.WithFieldContext(ctx, fc) + defer func() { + if r := recover(); r != nil { + ec.Error(ctx, ec.Recover(ctx, r)) + ret = graphql.Null + } + }() + resTmp, err := ec.ResolverMiddleware(ctx, func(rctx context.Context) (interface{}, error) { + ctx = rctx // use context from middleware stack in children + return obj.Description(), nil + }) + if err != nil { + ec.Error(ctx, err) + return graphql.Null + } + if resTmp == nil { + return graphql.Null + } + res := resTmp.(*string) + fc.Result = res + return ec.marshalOString2ᚖstring(ctx, field.Selections, res) +} + +func (ec *executionContext) fieldContext___EnumValue_description(_ context.Context, field graphql.CollectedField) (fc *graphql.FieldContext, err error) { + fc = &graphql.FieldContext{ + Object: "__EnumValue", + Field: field, + IsMethod: true, + IsResolver: false, + Child: func(ctx context.Context, field graphql.CollectedField) (*graphql.FieldContext, error) { + return nil, errors.New("field of type String does not have child fields") + }, + } + return fc, nil +} + +func (ec *executionContext) ___EnumValue_isDeprecated(ctx context.Context, field graphql.CollectedField, obj *introspection.EnumValue) (ret graphql.Marshaler) { + fc, err := ec.fieldContext___EnumValue_isDeprecated(ctx, field) + if err != nil { + return graphql.Null + } + ctx = graphql.WithFieldContext(ctx, fc) + defer func() { + if r := recover(); r != nil { + ec.Error(ctx, ec.Recover(ctx, r)) + ret = graphql.Null + } + }() + resTmp, err := ec.ResolverMiddleware(ctx, func(rctx context.Context) (interface{}, error) { + ctx = rctx // use context from middleware stack in children + return obj.IsDeprecated(), nil + }) + if err != nil { + ec.Error(ctx, err) + return graphql.Null + } + if resTmp == nil { + if !graphql.HasFieldError(ctx, fc) { + ec.Errorf(ctx, "must not be null") + } + return graphql.Null + } + res := resTmp.(bool) + fc.Result = res + return ec.marshalNBoolean2bool(ctx, field.Selections, res) +} + +func (ec *executionContext) fieldContext___EnumValue_isDeprecated(_ context.Context, field graphql.CollectedField) (fc *graphql.FieldContext, err error) { + fc = &graphql.FieldContext{ + Object: "__EnumValue", + Field: field, + IsMethod: true, + IsResolver: false, + Child: func(ctx context.Context, field graphql.CollectedField) (*graphql.FieldContext, error) { + return nil, errors.New("field of type Boolean does not have child fields") + }, + } + return fc, nil +} + +func (ec *executionContext) ___EnumValue_deprecationReason(ctx context.Context, field graphql.CollectedField, obj *introspection.EnumValue) (ret graphql.Marshaler) { + fc, err := ec.fieldContext___EnumValue_deprecationReason(ctx, field) + if err != nil { + return graphql.Null + } + ctx = graphql.WithFieldContext(ctx, fc) + defer func() { + if r := recover(); r != nil { + ec.Error(ctx, ec.Recover(ctx, r)) + ret = graphql.Null + } + }() + resTmp, err := ec.ResolverMiddleware(ctx, func(rctx context.Context) (interface{}, error) { + ctx = rctx // use context from middleware stack in children + return obj.DeprecationReason(), nil + }) + if err != nil { + ec.Error(ctx, err) + return graphql.Null + } + if resTmp == nil { + return graphql.Null + } + res := resTmp.(*string) + fc.Result = res + return ec.marshalOString2ᚖstring(ctx, field.Selections, res) +} + +func (ec *executionContext) fieldContext___EnumValue_deprecationReason(_ context.Context, field graphql.CollectedField) (fc *graphql.FieldContext, err error) { + fc = &graphql.FieldContext{ + Object: "__EnumValue", + Field: field, + IsMethod: true, + IsResolver: false, + Child: func(ctx context.Context, field graphql.CollectedField) (*graphql.FieldContext, error) { + return nil, errors.New("field of type String does not have child fields") + }, + } + return fc, nil +} + +func (ec *executionContext) ___Field_name(ctx context.Context, field graphql.CollectedField, obj *introspection.Field) (ret graphql.Marshaler) { + fc, err := ec.fieldContext___Field_name(ctx, field) + if err != nil { + return graphql.Null + } + ctx = graphql.WithFieldContext(ctx, fc) + defer func() { + if r := recover(); r != nil { + ec.Error(ctx, ec.Recover(ctx, r)) + ret = graphql.Null + } + }() + resTmp, err := ec.ResolverMiddleware(ctx, func(rctx context.Context) (interface{}, error) { + ctx = rctx // use context from middleware stack in children + return obj.Name, nil + }) + if err != nil { + ec.Error(ctx, err) + return graphql.Null + } + if resTmp == nil { + if !graphql.HasFieldError(ctx, fc) { + ec.Errorf(ctx, "must not be null") + } + return graphql.Null + } + res := resTmp.(string) + fc.Result = res + return ec.marshalNString2string(ctx, field.Selections, res) +} + +func (ec *executionContext) fieldContext___Field_name(_ context.Context, field graphql.CollectedField) (fc *graphql.FieldContext, err error) { + fc = &graphql.FieldContext{ + Object: "__Field", + Field: field, + IsMethod: false, + IsResolver: false, + Child: func(ctx context.Context, field graphql.CollectedField) (*graphql.FieldContext, error) { + return nil, errors.New("field of type String does not have child fields") + }, + } + return fc, nil +} + +func (ec *executionContext) ___Field_description(ctx context.Context, field graphql.CollectedField, obj *introspection.Field) (ret graphql.Marshaler) { + fc, err := ec.fieldContext___Field_description(ctx, field) + if err != nil { + return graphql.Null + } + ctx = graphql.WithFieldContext(ctx, fc) + defer func() { + if r := recover(); r != nil { + ec.Error(ctx, ec.Recover(ctx, r)) + ret = graphql.Null + } + }() + resTmp, err := ec.ResolverMiddleware(ctx, func(rctx context.Context) (interface{}, error) { + ctx = rctx // use context from middleware stack in children + return obj.Description(), nil + }) + if err != nil { + ec.Error(ctx, err) + return graphql.Null + } + if resTmp == nil { + return graphql.Null + } + res := resTmp.(*string) + fc.Result = res + return ec.marshalOString2ᚖstring(ctx, field.Selections, res) +} + +func (ec *executionContext) fieldContext___Field_description(_ context.Context, field graphql.CollectedField) (fc *graphql.FieldContext, err error) { + fc = &graphql.FieldContext{ + Object: "__Field", + Field: field, + IsMethod: true, + IsResolver: false, + Child: func(ctx context.Context, field graphql.CollectedField) (*graphql.FieldContext, error) { + return nil, errors.New("field of type String does not have child fields") + }, + } + return fc, nil +} + +func (ec *executionContext) ___Field_args(ctx context.Context, field graphql.CollectedField, obj *introspection.Field) (ret graphql.Marshaler) { + fc, err := ec.fieldContext___Field_args(ctx, field) + if err != nil { + return graphql.Null + } + ctx = graphql.WithFieldContext(ctx, fc) + defer func() { + if r := recover(); r != nil { + ec.Error(ctx, ec.Recover(ctx, r)) + ret = graphql.Null + } + }() + resTmp, err := ec.ResolverMiddleware(ctx, func(rctx context.Context) (interface{}, error) { + ctx = rctx // use context from middleware stack in children + return obj.Args, nil + }) + if err != nil { + ec.Error(ctx, err) + return graphql.Null + } + if resTmp == nil { + if !graphql.HasFieldError(ctx, fc) { + ec.Errorf(ctx, "must not be null") + } + return graphql.Null + } + res := resTmp.([]introspection.InputValue) + fc.Result = res + return ec.marshalN__InputValue2ᚕgithubᚗcomᚋ99designsᚋgqlgenᚋgraphqlᚋintrospectionᚐInputValueᚄ(ctx, field.Selections, res) +} + +func (ec *executionContext) fieldContext___Field_args(_ context.Context, field graphql.CollectedField) (fc *graphql.FieldContext, err error) { + fc = &graphql.FieldContext{ + Object: "__Field", + Field: field, + IsMethod: false, + IsResolver: false, + Child: func(ctx context.Context, field graphql.CollectedField) (*graphql.FieldContext, error) { + switch field.Name { + case "name": + return ec.fieldContext___InputValue_name(ctx, field) + case "description": + return ec.fieldContext___InputValue_description(ctx, field) + case "type": + return ec.fieldContext___InputValue_type(ctx, field) + case "defaultValue": + return ec.fieldContext___InputValue_defaultValue(ctx, field) + } + return nil, fmt.Errorf("no field named %q was found under type __InputValue", field.Name) + }, + } + return fc, nil +} + +func (ec *executionContext) ___Field_type(ctx context.Context, field graphql.CollectedField, obj *introspection.Field) (ret graphql.Marshaler) { + fc, err := ec.fieldContext___Field_type(ctx, field) + if err != nil { + return graphql.Null + } + ctx = graphql.WithFieldContext(ctx, fc) + defer func() { + if r := recover(); r != nil { + ec.Error(ctx, ec.Recover(ctx, r)) + ret = graphql.Null + } + }() + resTmp, err := ec.ResolverMiddleware(ctx, func(rctx context.Context) (interface{}, error) { + ctx = rctx // use context from middleware stack in children + return obj.Type, nil + }) + if err != nil { + ec.Error(ctx, err) + return graphql.Null + } + if resTmp == nil { + if !graphql.HasFieldError(ctx, fc) { + ec.Errorf(ctx, "must not be null") + } + return graphql.Null + } + res := resTmp.(*introspection.Type) + fc.Result = res + return ec.marshalN__Type2ᚖgithubᚗcomᚋ99designsᚋgqlgenᚋgraphqlᚋintrospectionᚐType(ctx, field.Selections, res) +} + +func (ec *executionContext) fieldContext___Field_type(_ context.Context, field graphql.CollectedField) (fc *graphql.FieldContext, err error) { + fc = &graphql.FieldContext{ + Object: "__Field", + Field: field, + IsMethod: false, + IsResolver: false, + Child: func(ctx context.Context, field graphql.CollectedField) (*graphql.FieldContext, error) { + switch field.Name { + case "kind": + return ec.fieldContext___Type_kind(ctx, field) + case "name": + return ec.fieldContext___Type_name(ctx, field) + case "description": + return ec.fieldContext___Type_description(ctx, field) + case "fields": + return ec.fieldContext___Type_fields(ctx, field) + case "interfaces": + return ec.fieldContext___Type_interfaces(ctx, field) + case "possibleTypes": + return ec.fieldContext___Type_possibleTypes(ctx, field) + case "enumValues": + return ec.fieldContext___Type_enumValues(ctx, field) + case "inputFields": + return ec.fieldContext___Type_inputFields(ctx, field) + case "ofType": + return ec.fieldContext___Type_ofType(ctx, field) + case "specifiedByURL": + return ec.fieldContext___Type_specifiedByURL(ctx, field) + } + return nil, fmt.Errorf("no field named %q was found under type __Type", field.Name) + }, + } + return fc, nil +} + +func (ec *executionContext) ___Field_isDeprecated(ctx context.Context, field graphql.CollectedField, obj *introspection.Field) (ret graphql.Marshaler) { + fc, err := ec.fieldContext___Field_isDeprecated(ctx, field) + if err != nil { + return graphql.Null + } + ctx = graphql.WithFieldContext(ctx, fc) + defer func() { + if r := recover(); r != nil { + ec.Error(ctx, ec.Recover(ctx, r)) + ret = graphql.Null + } + }() + resTmp, err := ec.ResolverMiddleware(ctx, func(rctx context.Context) (interface{}, error) { + ctx = rctx // use context from middleware stack in children + return obj.IsDeprecated(), nil + }) + if err != nil { + ec.Error(ctx, err) + return graphql.Null + } + if resTmp == nil { + if !graphql.HasFieldError(ctx, fc) { + ec.Errorf(ctx, "must not be null") + } + return graphql.Null + } + res := resTmp.(bool) + fc.Result = res + return ec.marshalNBoolean2bool(ctx, field.Selections, res) +} + +func (ec *executionContext) fieldContext___Field_isDeprecated(_ context.Context, field graphql.CollectedField) (fc *graphql.FieldContext, err error) { + fc = &graphql.FieldContext{ + Object: "__Field", + Field: field, + IsMethod: true, + IsResolver: false, + Child: func(ctx context.Context, field graphql.CollectedField) (*graphql.FieldContext, error) { + return nil, errors.New("field of type Boolean does not have child fields") + }, + } + return fc, nil +} + +func (ec *executionContext) ___Field_deprecationReason(ctx context.Context, field graphql.CollectedField, obj *introspection.Field) (ret graphql.Marshaler) { + fc, err := ec.fieldContext___Field_deprecationReason(ctx, field) + if err != nil { + return graphql.Null + } + ctx = graphql.WithFieldContext(ctx, fc) + defer func() { + if r := recover(); r != nil { + ec.Error(ctx, ec.Recover(ctx, r)) + ret = graphql.Null + } + }() + resTmp, err := ec.ResolverMiddleware(ctx, func(rctx context.Context) (interface{}, error) { + ctx = rctx // use context from middleware stack in children + return obj.DeprecationReason(), nil + }) + if err != nil { + ec.Error(ctx, err) + return graphql.Null + } + if resTmp == nil { + return graphql.Null + } + res := resTmp.(*string) + fc.Result = res + return ec.marshalOString2ᚖstring(ctx, field.Selections, res) +} + +func (ec *executionContext) fieldContext___Field_deprecationReason(_ context.Context, field graphql.CollectedField) (fc *graphql.FieldContext, err error) { + fc = &graphql.FieldContext{ + Object: "__Field", + Field: field, + IsMethod: true, + IsResolver: false, + Child: func(ctx context.Context, field graphql.CollectedField) (*graphql.FieldContext, error) { + return nil, errors.New("field of type String does not have child fields") + }, + } + return fc, nil +} + +func (ec *executionContext) ___InputValue_name(ctx context.Context, field graphql.CollectedField, obj *introspection.InputValue) (ret graphql.Marshaler) { + fc, err := ec.fieldContext___InputValue_name(ctx, field) + if err != nil { + return graphql.Null + } + ctx = graphql.WithFieldContext(ctx, fc) + defer func() { + if r := recover(); r != nil { + ec.Error(ctx, ec.Recover(ctx, r)) + ret = graphql.Null + } + }() + resTmp, err := ec.ResolverMiddleware(ctx, func(rctx context.Context) (interface{}, error) { + ctx = rctx // use context from middleware stack in children + return obj.Name, nil + }) + if err != nil { + ec.Error(ctx, err) + return graphql.Null + } + if resTmp == nil { + if !graphql.HasFieldError(ctx, fc) { + ec.Errorf(ctx, "must not be null") + } + return graphql.Null + } + res := resTmp.(string) + fc.Result = res + return ec.marshalNString2string(ctx, field.Selections, res) +} + +func (ec *executionContext) fieldContext___InputValue_name(_ context.Context, field graphql.CollectedField) (fc *graphql.FieldContext, err error) { + fc = &graphql.FieldContext{ + Object: "__InputValue", + Field: field, + IsMethod: false, + IsResolver: false, + Child: func(ctx context.Context, field graphql.CollectedField) (*graphql.FieldContext, error) { + return nil, errors.New("field of type String does not have child fields") + }, + } + return fc, nil +} + +func (ec *executionContext) ___InputValue_description(ctx context.Context, field graphql.CollectedField, obj *introspection.InputValue) (ret graphql.Marshaler) { + fc, err := ec.fieldContext___InputValue_description(ctx, field) + if err != nil { + return graphql.Null + } + ctx = graphql.WithFieldContext(ctx, fc) + defer func() { + if r := recover(); r != nil { + ec.Error(ctx, ec.Recover(ctx, r)) + ret = graphql.Null + } + }() + resTmp, err := ec.ResolverMiddleware(ctx, func(rctx context.Context) (interface{}, error) { + ctx = rctx // use context from middleware stack in children + return obj.Description(), nil + }) + if err != nil { + ec.Error(ctx, err) + return graphql.Null + } + if resTmp == nil { + return graphql.Null + } + res := resTmp.(*string) + fc.Result = res + return ec.marshalOString2ᚖstring(ctx, field.Selections, res) +} + +func (ec *executionContext) fieldContext___InputValue_description(_ context.Context, field graphql.CollectedField) (fc *graphql.FieldContext, err error) { + fc = &graphql.FieldContext{ + Object: "__InputValue", + Field: field, + IsMethod: true, + IsResolver: false, + Child: func(ctx context.Context, field graphql.CollectedField) (*graphql.FieldContext, error) { + return nil, errors.New("field of type String does not have child fields") + }, + } + return fc, nil +} + +func (ec *executionContext) ___InputValue_type(ctx context.Context, field graphql.CollectedField, obj *introspection.InputValue) (ret graphql.Marshaler) { + fc, err := ec.fieldContext___InputValue_type(ctx, field) + if err != nil { + return graphql.Null + } + ctx = graphql.WithFieldContext(ctx, fc) + defer func() { + if r := recover(); r != nil { + ec.Error(ctx, ec.Recover(ctx, r)) + ret = graphql.Null + } + }() + resTmp, err := ec.ResolverMiddleware(ctx, func(rctx context.Context) (interface{}, error) { + ctx = rctx // use context from middleware stack in children + return obj.Type, nil + }) + if err != nil { + ec.Error(ctx, err) + return graphql.Null + } + if resTmp == nil { + if !graphql.HasFieldError(ctx, fc) { + ec.Errorf(ctx, "must not be null") + } + return graphql.Null + } + res := resTmp.(*introspection.Type) + fc.Result = res + return ec.marshalN__Type2ᚖgithubᚗcomᚋ99designsᚋgqlgenᚋgraphqlᚋintrospectionᚐType(ctx, field.Selections, res) +} + +func (ec *executionContext) fieldContext___InputValue_type(_ context.Context, field graphql.CollectedField) (fc *graphql.FieldContext, err error) { + fc = &graphql.FieldContext{ + Object: "__InputValue", + Field: field, + IsMethod: false, + IsResolver: false, + Child: func(ctx context.Context, field graphql.CollectedField) (*graphql.FieldContext, error) { + switch field.Name { + case "kind": + return ec.fieldContext___Type_kind(ctx, field) + case "name": + return ec.fieldContext___Type_name(ctx, field) + case "description": + return ec.fieldContext___Type_description(ctx, field) + case "fields": + return ec.fieldContext___Type_fields(ctx, field) + case "interfaces": + return ec.fieldContext___Type_interfaces(ctx, field) + case "possibleTypes": + return ec.fieldContext___Type_possibleTypes(ctx, field) + case "enumValues": + return ec.fieldContext___Type_enumValues(ctx, field) + case "inputFields": + return ec.fieldContext___Type_inputFields(ctx, field) + case "ofType": + return ec.fieldContext___Type_ofType(ctx, field) + case "specifiedByURL": + return ec.fieldContext___Type_specifiedByURL(ctx, field) + } + return nil, fmt.Errorf("no field named %q was found under type __Type", field.Name) + }, + } + return fc, nil +} + +func (ec *executionContext) ___InputValue_defaultValue(ctx context.Context, field graphql.CollectedField, obj *introspection.InputValue) (ret graphql.Marshaler) { + fc, err := ec.fieldContext___InputValue_defaultValue(ctx, field) + if err != nil { + return graphql.Null + } + ctx = graphql.WithFieldContext(ctx, fc) + defer func() { + if r := recover(); r != nil { + ec.Error(ctx, ec.Recover(ctx, r)) + ret = graphql.Null + } + }() + resTmp, err := ec.ResolverMiddleware(ctx, func(rctx context.Context) (interface{}, error) { + ctx = rctx // use context from middleware stack in children + return obj.DefaultValue, nil + }) + if err != nil { + ec.Error(ctx, err) + return graphql.Null + } + if resTmp == nil { + return graphql.Null + } + res := resTmp.(*string) + fc.Result = res + return ec.marshalOString2ᚖstring(ctx, field.Selections, res) +} + +func (ec *executionContext) fieldContext___InputValue_defaultValue(_ context.Context, field graphql.CollectedField) (fc *graphql.FieldContext, err error) { + fc = &graphql.FieldContext{ + Object: "__InputValue", + Field: field, + IsMethod: false, + IsResolver: false, + Child: func(ctx context.Context, field graphql.CollectedField) (*graphql.FieldContext, error) { + return nil, errors.New("field of type String does not have child fields") + }, + } + return fc, nil +} + +func (ec *executionContext) ___Schema_description(ctx context.Context, field graphql.CollectedField, obj *introspection.Schema) (ret graphql.Marshaler) { + fc, err := ec.fieldContext___Schema_description(ctx, field) + if err != nil { + return graphql.Null + } + ctx = graphql.WithFieldContext(ctx, fc) + defer func() { + if r := recover(); r != nil { + ec.Error(ctx, ec.Recover(ctx, r)) + ret = graphql.Null + } + }() + resTmp, err := ec.ResolverMiddleware(ctx, func(rctx context.Context) (interface{}, error) { + ctx = rctx // use context from middleware stack in children + return obj.Description(), nil + }) + if err != nil { + ec.Error(ctx, err) + return graphql.Null + } + if resTmp == nil { + return graphql.Null + } + res := resTmp.(*string) + fc.Result = res + return ec.marshalOString2ᚖstring(ctx, field.Selections, res) +} + +func (ec *executionContext) fieldContext___Schema_description(_ context.Context, field graphql.CollectedField) (fc *graphql.FieldContext, err error) { + fc = &graphql.FieldContext{ + Object: "__Schema", + Field: field, + IsMethod: true, + IsResolver: false, + Child: func(ctx context.Context, field graphql.CollectedField) (*graphql.FieldContext, error) { + return nil, errors.New("field of type String does not have child fields") + }, + } + return fc, nil +} + +func (ec *executionContext) ___Schema_types(ctx context.Context, field graphql.CollectedField, obj *introspection.Schema) (ret graphql.Marshaler) { + fc, err := ec.fieldContext___Schema_types(ctx, field) + if err != nil { + return graphql.Null + } + ctx = graphql.WithFieldContext(ctx, fc) + defer func() { + if r := recover(); r != nil { + ec.Error(ctx, ec.Recover(ctx, r)) + ret = graphql.Null + } + }() + resTmp, err := ec.ResolverMiddleware(ctx, func(rctx context.Context) (interface{}, error) { + ctx = rctx // use context from middleware stack in children + return obj.Types(), nil + }) + if err != nil { + ec.Error(ctx, err) + return graphql.Null + } + if resTmp == nil { + if !graphql.HasFieldError(ctx, fc) { + ec.Errorf(ctx, "must not be null") + } + return graphql.Null + } + res := resTmp.([]introspection.Type) + fc.Result = res + return ec.marshalN__Type2ᚕgithubᚗcomᚋ99designsᚋgqlgenᚋgraphqlᚋintrospectionᚐTypeᚄ(ctx, field.Selections, res) +} + +func (ec *executionContext) fieldContext___Schema_types(_ context.Context, field graphql.CollectedField) (fc *graphql.FieldContext, err error) { + fc = &graphql.FieldContext{ + Object: "__Schema", + Field: field, + IsMethod: true, + IsResolver: false, + Child: func(ctx context.Context, field graphql.CollectedField) (*graphql.FieldContext, error) { + switch field.Name { + case "kind": + return ec.fieldContext___Type_kind(ctx, field) + case "name": + return ec.fieldContext___Type_name(ctx, field) + case "description": + return ec.fieldContext___Type_description(ctx, field) + case "fields": + return ec.fieldContext___Type_fields(ctx, field) + case "interfaces": + return ec.fieldContext___Type_interfaces(ctx, field) + case "possibleTypes": + return ec.fieldContext___Type_possibleTypes(ctx, field) + case "enumValues": + return ec.fieldContext___Type_enumValues(ctx, field) + case "inputFields": + return ec.fieldContext___Type_inputFields(ctx, field) + case "ofType": + return ec.fieldContext___Type_ofType(ctx, field) + case "specifiedByURL": + return ec.fieldContext___Type_specifiedByURL(ctx, field) + } + return nil, fmt.Errorf("no field named %q was found under type __Type", field.Name) + }, + } + return fc, nil +} + +func (ec *executionContext) ___Schema_queryType(ctx context.Context, field graphql.CollectedField, obj *introspection.Schema) (ret graphql.Marshaler) { + fc, err := ec.fieldContext___Schema_queryType(ctx, field) + if err != nil { + return graphql.Null + } + ctx = graphql.WithFieldContext(ctx, fc) + defer func() { + if r := recover(); r != nil { + ec.Error(ctx, ec.Recover(ctx, r)) + ret = graphql.Null + } + }() + resTmp, err := ec.ResolverMiddleware(ctx, func(rctx context.Context) (interface{}, error) { + ctx = rctx // use context from middleware stack in children + return obj.QueryType(), nil + }) + if err != nil { + ec.Error(ctx, err) + return graphql.Null + } + if resTmp == nil { + if !graphql.HasFieldError(ctx, fc) { + ec.Errorf(ctx, "must not be null") + } + return graphql.Null + } + res := resTmp.(*introspection.Type) + fc.Result = res + return ec.marshalN__Type2ᚖgithubᚗcomᚋ99designsᚋgqlgenᚋgraphqlᚋintrospectionᚐType(ctx, field.Selections, res) +} + +func (ec *executionContext) fieldContext___Schema_queryType(_ context.Context, field graphql.CollectedField) (fc *graphql.FieldContext, err error) { + fc = &graphql.FieldContext{ + Object: "__Schema", + Field: field, + IsMethod: true, + IsResolver: false, + Child: func(ctx context.Context, field graphql.CollectedField) (*graphql.FieldContext, error) { + switch field.Name { + case "kind": + return ec.fieldContext___Type_kind(ctx, field) + case "name": + return ec.fieldContext___Type_name(ctx, field) + case "description": + return ec.fieldContext___Type_description(ctx, field) + case "fields": + return ec.fieldContext___Type_fields(ctx, field) + case "interfaces": + return ec.fieldContext___Type_interfaces(ctx, field) + case "possibleTypes": + return ec.fieldContext___Type_possibleTypes(ctx, field) + case "enumValues": + return ec.fieldContext___Type_enumValues(ctx, field) + case "inputFields": + return ec.fieldContext___Type_inputFields(ctx, field) + case "ofType": + return ec.fieldContext___Type_ofType(ctx, field) + case "specifiedByURL": + return ec.fieldContext___Type_specifiedByURL(ctx, field) + } + return nil, fmt.Errorf("no field named %q was found under type __Type", field.Name) + }, + } + return fc, nil +} + +func (ec *executionContext) ___Schema_mutationType(ctx context.Context, field graphql.CollectedField, obj *introspection.Schema) (ret graphql.Marshaler) { + fc, err := ec.fieldContext___Schema_mutationType(ctx, field) + if err != nil { + return graphql.Null + } + ctx = graphql.WithFieldContext(ctx, fc) + defer func() { + if r := recover(); r != nil { + ec.Error(ctx, ec.Recover(ctx, r)) + ret = graphql.Null + } + }() + resTmp, err := ec.ResolverMiddleware(ctx, func(rctx context.Context) (interface{}, error) { + ctx = rctx // use context from middleware stack in children + return obj.MutationType(), nil + }) + if err != nil { + ec.Error(ctx, err) + return graphql.Null + } + if resTmp == nil { + return graphql.Null + } + res := resTmp.(*introspection.Type) + fc.Result = res + return ec.marshalO__Type2ᚖgithubᚗcomᚋ99designsᚋgqlgenᚋgraphqlᚋintrospectionᚐType(ctx, field.Selections, res) +} + +func (ec *executionContext) fieldContext___Schema_mutationType(_ context.Context, field graphql.CollectedField) (fc *graphql.FieldContext, err error) { + fc = &graphql.FieldContext{ + Object: "__Schema", + Field: field, + IsMethod: true, + IsResolver: false, + Child: func(ctx context.Context, field graphql.CollectedField) (*graphql.FieldContext, error) { + switch field.Name { + case "kind": + return ec.fieldContext___Type_kind(ctx, field) + case "name": + return ec.fieldContext___Type_name(ctx, field) + case "description": + return ec.fieldContext___Type_description(ctx, field) + case "fields": + return ec.fieldContext___Type_fields(ctx, field) + case "interfaces": + return ec.fieldContext___Type_interfaces(ctx, field) + case "possibleTypes": + return ec.fieldContext___Type_possibleTypes(ctx, field) + case "enumValues": + return ec.fieldContext___Type_enumValues(ctx, field) + case "inputFields": + return ec.fieldContext___Type_inputFields(ctx, field) + case "ofType": + return ec.fieldContext___Type_ofType(ctx, field) + case "specifiedByURL": + return ec.fieldContext___Type_specifiedByURL(ctx, field) + } + return nil, fmt.Errorf("no field named %q was found under type __Type", field.Name) + }, + } + return fc, nil +} + +func (ec *executionContext) ___Schema_subscriptionType(ctx context.Context, field graphql.CollectedField, obj *introspection.Schema) (ret graphql.Marshaler) { + fc, err := ec.fieldContext___Schema_subscriptionType(ctx, field) + if err != nil { + return graphql.Null + } + ctx = graphql.WithFieldContext(ctx, fc) + defer func() { + if r := recover(); r != nil { + ec.Error(ctx, ec.Recover(ctx, r)) + ret = graphql.Null + } + }() + resTmp, err := ec.ResolverMiddleware(ctx, func(rctx context.Context) (interface{}, error) { + ctx = rctx // use context from middleware stack in children + return obj.SubscriptionType(), nil + }) + if err != nil { + ec.Error(ctx, err) + return graphql.Null + } + if resTmp == nil { + return graphql.Null + } + res := resTmp.(*introspection.Type) + fc.Result = res + return ec.marshalO__Type2ᚖgithubᚗcomᚋ99designsᚋgqlgenᚋgraphqlᚋintrospectionᚐType(ctx, field.Selections, res) +} + +func (ec *executionContext) fieldContext___Schema_subscriptionType(_ context.Context, field graphql.CollectedField) (fc *graphql.FieldContext, err error) { + fc = &graphql.FieldContext{ + Object: "__Schema", + Field: field, + IsMethod: true, + IsResolver: false, + Child: func(ctx context.Context, field graphql.CollectedField) (*graphql.FieldContext, error) { + switch field.Name { + case "kind": + return ec.fieldContext___Type_kind(ctx, field) + case "name": + return ec.fieldContext___Type_name(ctx, field) + case "description": + return ec.fieldContext___Type_description(ctx, field) + case "fields": + return ec.fieldContext___Type_fields(ctx, field) + case "interfaces": + return ec.fieldContext___Type_interfaces(ctx, field) + case "possibleTypes": + return ec.fieldContext___Type_possibleTypes(ctx, field) + case "enumValues": + return ec.fieldContext___Type_enumValues(ctx, field) + case "inputFields": + return ec.fieldContext___Type_inputFields(ctx, field) + case "ofType": + return ec.fieldContext___Type_ofType(ctx, field) + case "specifiedByURL": + return ec.fieldContext___Type_specifiedByURL(ctx, field) + } + return nil, fmt.Errorf("no field named %q was found under type __Type", field.Name) + }, + } + return fc, nil +} + +func (ec *executionContext) ___Schema_directives(ctx context.Context, field graphql.CollectedField, obj *introspection.Schema) (ret graphql.Marshaler) { + fc, err := ec.fieldContext___Schema_directives(ctx, field) + if err != nil { + return graphql.Null + } + ctx = graphql.WithFieldContext(ctx, fc) + defer func() { + if r := recover(); r != nil { + ec.Error(ctx, ec.Recover(ctx, r)) + ret = graphql.Null + } + }() + resTmp, err := ec.ResolverMiddleware(ctx, func(rctx context.Context) (interface{}, error) { + ctx = rctx // use context from middleware stack in children + return obj.Directives(), nil + }) + if err != nil { + ec.Error(ctx, err) + return graphql.Null + } + if resTmp == nil { + if !graphql.HasFieldError(ctx, fc) { + ec.Errorf(ctx, "must not be null") + } + return graphql.Null + } + res := resTmp.([]introspection.Directive) + fc.Result = res + return ec.marshalN__Directive2ᚕgithubᚗcomᚋ99designsᚋgqlgenᚋgraphqlᚋintrospectionᚐDirectiveᚄ(ctx, field.Selections, res) +} + +func (ec *executionContext) fieldContext___Schema_directives(_ context.Context, field graphql.CollectedField) (fc *graphql.FieldContext, err error) { + fc = &graphql.FieldContext{ + Object: "__Schema", + Field: field, + IsMethod: true, + IsResolver: false, + Child: func(ctx context.Context, field graphql.CollectedField) (*graphql.FieldContext, error) { + switch field.Name { + case "name": + return ec.fieldContext___Directive_name(ctx, field) + case "description": + return ec.fieldContext___Directive_description(ctx, field) + case "locations": + return ec.fieldContext___Directive_locations(ctx, field) + case "args": + return ec.fieldContext___Directive_args(ctx, field) + case "isRepeatable": + return ec.fieldContext___Directive_isRepeatable(ctx, field) + } + return nil, fmt.Errorf("no field named %q was found under type __Directive", field.Name) + }, + } + return fc, nil +} + +func (ec *executionContext) ___Type_kind(ctx context.Context, field graphql.CollectedField, obj *introspection.Type) (ret graphql.Marshaler) { + fc, err := ec.fieldContext___Type_kind(ctx, field) + if err != nil { + return graphql.Null + } + ctx = graphql.WithFieldContext(ctx, fc) + defer func() { + if r := recover(); r != nil { + ec.Error(ctx, ec.Recover(ctx, r)) + ret = graphql.Null + } + }() + resTmp, err := ec.ResolverMiddleware(ctx, func(rctx context.Context) (interface{}, error) { + ctx = rctx // use context from middleware stack in children + return obj.Kind(), nil + }) + if err != nil { + ec.Error(ctx, err) + return graphql.Null + } + if resTmp == nil { + if !graphql.HasFieldError(ctx, fc) { + ec.Errorf(ctx, "must not be null") + } + return graphql.Null + } + res := resTmp.(string) + fc.Result = res + return ec.marshalN__TypeKind2string(ctx, field.Selections, res) +} + +func (ec *executionContext) fieldContext___Type_kind(_ context.Context, field graphql.CollectedField) (fc *graphql.FieldContext, err error) { + fc = &graphql.FieldContext{ + Object: "__Type", + Field: field, + IsMethod: true, + IsResolver: false, + Child: func(ctx context.Context, field graphql.CollectedField) (*graphql.FieldContext, error) { + return nil, errors.New("field of type __TypeKind does not have child fields") + }, + } + return fc, nil +} + +func (ec *executionContext) ___Type_name(ctx context.Context, field graphql.CollectedField, obj *introspection.Type) (ret graphql.Marshaler) { + fc, err := ec.fieldContext___Type_name(ctx, field) + if err != nil { + return graphql.Null + } + ctx = graphql.WithFieldContext(ctx, fc) + defer func() { + if r := recover(); r != nil { + ec.Error(ctx, ec.Recover(ctx, r)) + ret = graphql.Null + } + }() + resTmp, err := ec.ResolverMiddleware(ctx, func(rctx context.Context) (interface{}, error) { + ctx = rctx // use context from middleware stack in children + return obj.Name(), nil + }) + if err != nil { + ec.Error(ctx, err) + return graphql.Null + } + if resTmp == nil { + return graphql.Null + } + res := resTmp.(*string) + fc.Result = res + return ec.marshalOString2ᚖstring(ctx, field.Selections, res) +} + +func (ec *executionContext) fieldContext___Type_name(_ context.Context, field graphql.CollectedField) (fc *graphql.FieldContext, err error) { + fc = &graphql.FieldContext{ + Object: "__Type", + Field: field, + IsMethod: true, + IsResolver: false, + Child: func(ctx context.Context, field graphql.CollectedField) (*graphql.FieldContext, error) { + return nil, errors.New("field of type String does not have child fields") + }, + } + return fc, nil +} + +func (ec *executionContext) ___Type_description(ctx context.Context, field graphql.CollectedField, obj *introspection.Type) (ret graphql.Marshaler) { + fc, err := ec.fieldContext___Type_description(ctx, field) + if err != nil { + return graphql.Null + } + ctx = graphql.WithFieldContext(ctx, fc) + defer func() { + if r := recover(); r != nil { + ec.Error(ctx, ec.Recover(ctx, r)) + ret = graphql.Null + } + }() + resTmp, err := ec.ResolverMiddleware(ctx, func(rctx context.Context) (interface{}, error) { + ctx = rctx // use context from middleware stack in children + return obj.Description(), nil + }) + if err != nil { + ec.Error(ctx, err) + return graphql.Null + } + if resTmp == nil { + return graphql.Null + } + res := resTmp.(*string) + fc.Result = res + return ec.marshalOString2ᚖstring(ctx, field.Selections, res) +} + +func (ec *executionContext) fieldContext___Type_description(_ context.Context, field graphql.CollectedField) (fc *graphql.FieldContext, err error) { + fc = &graphql.FieldContext{ + Object: "__Type", + Field: field, + IsMethod: true, + IsResolver: false, + Child: func(ctx context.Context, field graphql.CollectedField) (*graphql.FieldContext, error) { + return nil, errors.New("field of type String does not have child fields") + }, + } + return fc, nil +} + +func (ec *executionContext) ___Type_fields(ctx context.Context, field graphql.CollectedField, obj *introspection.Type) (ret graphql.Marshaler) { + fc, err := ec.fieldContext___Type_fields(ctx, field) + if err != nil { + return graphql.Null + } + ctx = graphql.WithFieldContext(ctx, fc) + defer func() { + if r := recover(); r != nil { + ec.Error(ctx, ec.Recover(ctx, r)) + ret = graphql.Null + } + }() + resTmp, err := ec.ResolverMiddleware(ctx, func(rctx context.Context) (interface{}, error) { + ctx = rctx // use context from middleware stack in children + return obj.Fields(fc.Args["includeDeprecated"].(bool)), nil + }) + if err != nil { + ec.Error(ctx, err) + return graphql.Null + } + if resTmp == nil { + return graphql.Null + } + res := resTmp.([]introspection.Field) + fc.Result = res + return ec.marshalO__Field2ᚕgithubᚗcomᚋ99designsᚋgqlgenᚋgraphqlᚋintrospectionᚐFieldᚄ(ctx, field.Selections, res) +} + +func (ec *executionContext) fieldContext___Type_fields(ctx context.Context, field graphql.CollectedField) (fc *graphql.FieldContext, err error) { + fc = &graphql.FieldContext{ + Object: "__Type", + Field: field, + IsMethod: true, + IsResolver: false, + Child: func(ctx context.Context, field graphql.CollectedField) (*graphql.FieldContext, error) { + switch field.Name { + case "name": + return ec.fieldContext___Field_name(ctx, field) + case "description": + return ec.fieldContext___Field_description(ctx, field) + case "args": + return ec.fieldContext___Field_args(ctx, field) + case "type": + return ec.fieldContext___Field_type(ctx, field) + case "isDeprecated": + return ec.fieldContext___Field_isDeprecated(ctx, field) + case "deprecationReason": + return ec.fieldContext___Field_deprecationReason(ctx, field) + } + return nil, fmt.Errorf("no field named %q was found under type __Field", field.Name) + }, + } + defer func() { + if r := recover(); r != nil { + err = ec.Recover(ctx, r) + ec.Error(ctx, err) + } + }() + ctx = graphql.WithFieldContext(ctx, fc) + if fc.Args, err = ec.field___Type_fields_args(ctx, field.ArgumentMap(ec.Variables)); err != nil { + ec.Error(ctx, err) + return fc, err + } + return fc, nil +} + +func (ec *executionContext) ___Type_interfaces(ctx context.Context, field graphql.CollectedField, obj *introspection.Type) (ret graphql.Marshaler) { + fc, err := ec.fieldContext___Type_interfaces(ctx, field) + if err != nil { + return graphql.Null + } + ctx = graphql.WithFieldContext(ctx, fc) + defer func() { + if r := recover(); r != nil { + ec.Error(ctx, ec.Recover(ctx, r)) + ret = graphql.Null + } + }() + resTmp, err := ec.ResolverMiddleware(ctx, func(rctx context.Context) (interface{}, error) { + ctx = rctx // use context from middleware stack in children + return obj.Interfaces(), nil + }) + if err != nil { + ec.Error(ctx, err) + return graphql.Null + } + if resTmp == nil { + return graphql.Null + } + res := resTmp.([]introspection.Type) + fc.Result = res + return ec.marshalO__Type2ᚕgithubᚗcomᚋ99designsᚋgqlgenᚋgraphqlᚋintrospectionᚐTypeᚄ(ctx, field.Selections, res) +} + +func (ec *executionContext) fieldContext___Type_interfaces(_ context.Context, field graphql.CollectedField) (fc *graphql.FieldContext, err error) { + fc = &graphql.FieldContext{ + Object: "__Type", + Field: field, + IsMethod: true, + IsResolver: false, + Child: func(ctx context.Context, field graphql.CollectedField) (*graphql.FieldContext, error) { + switch field.Name { + case "kind": + return ec.fieldContext___Type_kind(ctx, field) + case "name": + return ec.fieldContext___Type_name(ctx, field) + case "description": + return ec.fieldContext___Type_description(ctx, field) + case "fields": + return ec.fieldContext___Type_fields(ctx, field) + case "interfaces": + return ec.fieldContext___Type_interfaces(ctx, field) + case "possibleTypes": + return ec.fieldContext___Type_possibleTypes(ctx, field) + case "enumValues": + return ec.fieldContext___Type_enumValues(ctx, field) + case "inputFields": + return ec.fieldContext___Type_inputFields(ctx, field) + case "ofType": + return ec.fieldContext___Type_ofType(ctx, field) + case "specifiedByURL": + return ec.fieldContext___Type_specifiedByURL(ctx, field) + } + return nil, fmt.Errorf("no field named %q was found under type __Type", field.Name) + }, + } + return fc, nil +} + +func (ec *executionContext) ___Type_possibleTypes(ctx context.Context, field graphql.CollectedField, obj *introspection.Type) (ret graphql.Marshaler) { + fc, err := ec.fieldContext___Type_possibleTypes(ctx, field) + if err != nil { + return graphql.Null + } + ctx = graphql.WithFieldContext(ctx, fc) + defer func() { + if r := recover(); r != nil { + ec.Error(ctx, ec.Recover(ctx, r)) + ret = graphql.Null + } + }() + resTmp, err := ec.ResolverMiddleware(ctx, func(rctx context.Context) (interface{}, error) { + ctx = rctx // use context from middleware stack in children + return obj.PossibleTypes(), nil + }) + if err != nil { + ec.Error(ctx, err) + return graphql.Null + } + if resTmp == nil { + return graphql.Null + } + res := resTmp.([]introspection.Type) + fc.Result = res + return ec.marshalO__Type2ᚕgithubᚗcomᚋ99designsᚋgqlgenᚋgraphqlᚋintrospectionᚐTypeᚄ(ctx, field.Selections, res) +} + +func (ec *executionContext) fieldContext___Type_possibleTypes(_ context.Context, field graphql.CollectedField) (fc *graphql.FieldContext, err error) { + fc = &graphql.FieldContext{ + Object: "__Type", + Field: field, + IsMethod: true, + IsResolver: false, + Child: func(ctx context.Context, field graphql.CollectedField) (*graphql.FieldContext, error) { + switch field.Name { + case "kind": + return ec.fieldContext___Type_kind(ctx, field) + case "name": + return ec.fieldContext___Type_name(ctx, field) + case "description": + return ec.fieldContext___Type_description(ctx, field) + case "fields": + return ec.fieldContext___Type_fields(ctx, field) + case "interfaces": + return ec.fieldContext___Type_interfaces(ctx, field) + case "possibleTypes": + return ec.fieldContext___Type_possibleTypes(ctx, field) + case "enumValues": + return ec.fieldContext___Type_enumValues(ctx, field) + case "inputFields": + return ec.fieldContext___Type_inputFields(ctx, field) + case "ofType": + return ec.fieldContext___Type_ofType(ctx, field) + case "specifiedByURL": + return ec.fieldContext___Type_specifiedByURL(ctx, field) + } + return nil, fmt.Errorf("no field named %q was found under type __Type", field.Name) + }, + } + return fc, nil +} + +func (ec *executionContext) ___Type_enumValues(ctx context.Context, field graphql.CollectedField, obj *introspection.Type) (ret graphql.Marshaler) { + fc, err := ec.fieldContext___Type_enumValues(ctx, field) + if err != nil { + return graphql.Null + } + ctx = graphql.WithFieldContext(ctx, fc) + defer func() { + if r := recover(); r != nil { + ec.Error(ctx, ec.Recover(ctx, r)) + ret = graphql.Null + } + }() + resTmp, err := ec.ResolverMiddleware(ctx, func(rctx context.Context) (interface{}, error) { + ctx = rctx // use context from middleware stack in children + return obj.EnumValues(fc.Args["includeDeprecated"].(bool)), nil + }) + if err != nil { + ec.Error(ctx, err) + return graphql.Null + } + if resTmp == nil { + return graphql.Null + } + res := resTmp.([]introspection.EnumValue) + fc.Result = res + return ec.marshalO__EnumValue2ᚕgithubᚗcomᚋ99designsᚋgqlgenᚋgraphqlᚋintrospectionᚐEnumValueᚄ(ctx, field.Selections, res) +} + +func (ec *executionContext) fieldContext___Type_enumValues(ctx context.Context, field graphql.CollectedField) (fc *graphql.FieldContext, err error) { + fc = &graphql.FieldContext{ + Object: "__Type", + Field: field, + IsMethod: true, + IsResolver: false, + Child: func(ctx context.Context, field graphql.CollectedField) (*graphql.FieldContext, error) { + switch field.Name { + case "name": + return ec.fieldContext___EnumValue_name(ctx, field) + case "description": + return ec.fieldContext___EnumValue_description(ctx, field) + case "isDeprecated": + return ec.fieldContext___EnumValue_isDeprecated(ctx, field) + case "deprecationReason": + return ec.fieldContext___EnumValue_deprecationReason(ctx, field) + } + return nil, fmt.Errorf("no field named %q was found under type __EnumValue", field.Name) + }, + } + defer func() { + if r := recover(); r != nil { + err = ec.Recover(ctx, r) + ec.Error(ctx, err) + } + }() + ctx = graphql.WithFieldContext(ctx, fc) + if fc.Args, err = ec.field___Type_enumValues_args(ctx, field.ArgumentMap(ec.Variables)); err != nil { + ec.Error(ctx, err) + return fc, err + } + return fc, nil +} + +func (ec *executionContext) ___Type_inputFields(ctx context.Context, field graphql.CollectedField, obj *introspection.Type) (ret graphql.Marshaler) { + fc, err := ec.fieldContext___Type_inputFields(ctx, field) + if err != nil { + return graphql.Null + } + ctx = graphql.WithFieldContext(ctx, fc) + defer func() { + if r := recover(); r != nil { + ec.Error(ctx, ec.Recover(ctx, r)) + ret = graphql.Null + } + }() + resTmp, err := ec.ResolverMiddleware(ctx, func(rctx context.Context) (interface{}, error) { + ctx = rctx // use context from middleware stack in children + return obj.InputFields(), nil + }) + if err != nil { + ec.Error(ctx, err) + return graphql.Null + } + if resTmp == nil { + return graphql.Null + } + res := resTmp.([]introspection.InputValue) + fc.Result = res + return ec.marshalO__InputValue2ᚕgithubᚗcomᚋ99designsᚋgqlgenᚋgraphqlᚋintrospectionᚐInputValueᚄ(ctx, field.Selections, res) +} + +func (ec *executionContext) fieldContext___Type_inputFields(_ context.Context, field graphql.CollectedField) (fc *graphql.FieldContext, err error) { + fc = &graphql.FieldContext{ + Object: "__Type", + Field: field, + IsMethod: true, + IsResolver: false, + Child: func(ctx context.Context, field graphql.CollectedField) (*graphql.FieldContext, error) { + switch field.Name { + case "name": + return ec.fieldContext___InputValue_name(ctx, field) + case "description": + return ec.fieldContext___InputValue_description(ctx, field) + case "type": + return ec.fieldContext___InputValue_type(ctx, field) + case "defaultValue": + return ec.fieldContext___InputValue_defaultValue(ctx, field) + } + return nil, fmt.Errorf("no field named %q was found under type __InputValue", field.Name) + }, + } + return fc, nil +} + +func (ec *executionContext) ___Type_ofType(ctx context.Context, field graphql.CollectedField, obj *introspection.Type) (ret graphql.Marshaler) { + fc, err := ec.fieldContext___Type_ofType(ctx, field) + if err != nil { + return graphql.Null + } + ctx = graphql.WithFieldContext(ctx, fc) + defer func() { + if r := recover(); r != nil { + ec.Error(ctx, ec.Recover(ctx, r)) + ret = graphql.Null + } + }() + resTmp, err := ec.ResolverMiddleware(ctx, func(rctx context.Context) (interface{}, error) { + ctx = rctx // use context from middleware stack in children + return obj.OfType(), nil + }) + if err != nil { + ec.Error(ctx, err) + return graphql.Null + } + if resTmp == nil { + return graphql.Null + } + res := resTmp.(*introspection.Type) + fc.Result = res + return ec.marshalO__Type2ᚖgithubᚗcomᚋ99designsᚋgqlgenᚋgraphqlᚋintrospectionᚐType(ctx, field.Selections, res) +} + +func (ec *executionContext) fieldContext___Type_ofType(_ context.Context, field graphql.CollectedField) (fc *graphql.FieldContext, err error) { + fc = &graphql.FieldContext{ + Object: "__Type", + Field: field, + IsMethod: true, + IsResolver: false, + Child: func(ctx context.Context, field graphql.CollectedField) (*graphql.FieldContext, error) { + switch field.Name { + case "kind": + return ec.fieldContext___Type_kind(ctx, field) + case "name": + return ec.fieldContext___Type_name(ctx, field) + case "description": + return ec.fieldContext___Type_description(ctx, field) + case "fields": + return ec.fieldContext___Type_fields(ctx, field) + case "interfaces": + return ec.fieldContext___Type_interfaces(ctx, field) + case "possibleTypes": + return ec.fieldContext___Type_possibleTypes(ctx, field) + case "enumValues": + return ec.fieldContext___Type_enumValues(ctx, field) + case "inputFields": + return ec.fieldContext___Type_inputFields(ctx, field) + case "ofType": + return ec.fieldContext___Type_ofType(ctx, field) + case "specifiedByURL": + return ec.fieldContext___Type_specifiedByURL(ctx, field) + } + return nil, fmt.Errorf("no field named %q was found under type __Type", field.Name) + }, + } + return fc, nil +} + +func (ec *executionContext) ___Type_specifiedByURL(ctx context.Context, field graphql.CollectedField, obj *introspection.Type) (ret graphql.Marshaler) { + fc, err := ec.fieldContext___Type_specifiedByURL(ctx, field) + if err != nil { + return graphql.Null + } + ctx = graphql.WithFieldContext(ctx, fc) + defer func() { + if r := recover(); r != nil { + ec.Error(ctx, ec.Recover(ctx, r)) + ret = graphql.Null + } + }() + resTmp, err := ec.ResolverMiddleware(ctx, func(rctx context.Context) (interface{}, error) { + ctx = rctx // use context from middleware stack in children + return obj.SpecifiedByURL(), nil + }) + if err != nil { + ec.Error(ctx, err) + return graphql.Null + } + if resTmp == nil { + return graphql.Null + } + res := resTmp.(*string) + fc.Result = res + return ec.marshalOString2ᚖstring(ctx, field.Selections, res) +} + +func (ec *executionContext) fieldContext___Type_specifiedByURL(_ context.Context, field graphql.CollectedField) (fc *graphql.FieldContext, err error) { + fc = &graphql.FieldContext{ + Object: "__Type", + Field: field, + IsMethod: true, + IsResolver: false, + Child: func(ctx context.Context, field graphql.CollectedField) (*graphql.FieldContext, error) { + return nil, errors.New("field of type String does not have child fields") + }, + } + return fc, nil +} + +// endregion **************************** field.gotpl ***************************** + +// region **************************** input.gotpl ***************************** + +func (ec *executionContext) unmarshalInputDestinationInput(ctx context.Context, obj interface{}) (model.DestinationInput, error) { + var it model.DestinationInput + asMap := map[string]interface{}{} + for k, v := range obj.(map[string]interface{}) { + asMap[k] = v + } + + fieldsInOrder := [...]string{"name", "type", "exportedSignals", "fields"} + for _, k := range fieldsInOrder { + v, ok := asMap[k] + if !ok { + continue + } + switch k { + case "name": + ctx := graphql.WithPathContext(ctx, graphql.NewPathWithField("name")) + data, err := ec.unmarshalNString2string(ctx, v) + if err != nil { + return it, err + } + it.Name = data + case "type": + ctx := graphql.WithPathContext(ctx, graphql.NewPathWithField("type")) + data, err := ec.unmarshalNString2string(ctx, v) + if err != nil { + return it, err + } + it.Type = data + case "exportedSignals": + ctx := graphql.WithPathContext(ctx, graphql.NewPathWithField("exportedSignals")) + data, err := ec.unmarshalNExportedSignalsInput2ᚖgithubᚗcomᚋodigosᚑioᚋodigosᚋfrontendᚋgraphᚋmodelᚐExportedSignalsInput(ctx, v) + if err != nil { + return it, err + } + it.ExportedSignals = data + case "fields": + ctx := graphql.WithPathContext(ctx, graphql.NewPathWithField("fields")) + data, err := ec.unmarshalNFieldInput2ᚕᚖgithubᚗcomᚋodigosᚑioᚋodigosᚋfrontendᚋgraphᚋmodelᚐFieldInputᚄ(ctx, v) + if err != nil { + return it, err + } + it.Fields = data + } + } + + return it, nil +} + +func (ec *executionContext) unmarshalInputExportedSignalsInput(ctx context.Context, obj interface{}) (model.ExportedSignalsInput, error) { + var it model.ExportedSignalsInput + asMap := map[string]interface{}{} + for k, v := range obj.(map[string]interface{}) { + asMap[k] = v + } + + fieldsInOrder := [...]string{"traces", "metrics", "logs"} + for _, k := range fieldsInOrder { + v, ok := asMap[k] + if !ok { + continue + } + switch k { + case "traces": + ctx := graphql.WithPathContext(ctx, graphql.NewPathWithField("traces")) + data, err := ec.unmarshalNBoolean2bool(ctx, v) + if err != nil { + return it, err + } + it.Traces = data + case "metrics": + ctx := graphql.WithPathContext(ctx, graphql.NewPathWithField("metrics")) + data, err := ec.unmarshalNBoolean2bool(ctx, v) + if err != nil { + return it, err + } + it.Metrics = data + case "logs": + ctx := graphql.WithPathContext(ctx, graphql.NewPathWithField("logs")) + data, err := ec.unmarshalNBoolean2bool(ctx, v) + if err != nil { + return it, err + } + it.Logs = data + } + } + + return it, nil +} + +func (ec *executionContext) unmarshalInputFieldInput(ctx context.Context, obj interface{}) (model.FieldInput, error) { + var it model.FieldInput + asMap := map[string]interface{}{} + for k, v := range obj.(map[string]interface{}) { + asMap[k] = v + } + + fieldsInOrder := [...]string{"key", "value"} + for _, k := range fieldsInOrder { + v, ok := asMap[k] + if !ok { + continue + } + switch k { + case "key": + ctx := graphql.WithPathContext(ctx, graphql.NewPathWithField("key")) + data, err := ec.unmarshalNString2string(ctx, v) + if err != nil { + return it, err + } + it.Key = data + case "value": + ctx := graphql.WithPathContext(ctx, graphql.NewPathWithField("value")) + data, err := ec.unmarshalNString2string(ctx, v) + if err != nil { + return it, err + } + it.Value = data + } + } + + return it, nil +} + +func (ec *executionContext) unmarshalInputK8sDesiredNamespaceInput(ctx context.Context, obj interface{}) (model.K8sDesiredNamespaceInput, error) { + var it model.K8sDesiredNamespaceInput + asMap := map[string]interface{}{} + for k, v := range obj.(map[string]interface{}) { + asMap[k] = v + } + + fieldsInOrder := [...]string{"autoInstrument"} + for _, k := range fieldsInOrder { + v, ok := asMap[k] + if !ok { + continue + } + switch k { + case "autoInstrument": + ctx := graphql.WithPathContext(ctx, graphql.NewPathWithField("autoInstrument")) + data, err := ec.unmarshalOBoolean2ᚖbool(ctx, v) + if err != nil { + return it, err + } + it.AutoInstrument = data + } + } + + return it, nil +} + +func (ec *executionContext) unmarshalInputK8sDesiredSourceInput(ctx context.Context, obj interface{}) (model.K8sDesiredSourceInput, error) { + var it model.K8sDesiredSourceInput + asMap := map[string]interface{}{} + for k, v := range obj.(map[string]interface{}) { + asMap[k] = v + } + + fieldsInOrder := [...]string{"serviceName", "autoInstrument"} + for _, k := range fieldsInOrder { + v, ok := asMap[k] + if !ok { + continue + } + switch k { + case "serviceName": + ctx := graphql.WithPathContext(ctx, graphql.NewPathWithField("serviceName")) + data, err := ec.unmarshalOString2ᚖstring(ctx, v) + if err != nil { + return it, err + } + it.ServiceName = data + case "autoInstrument": + ctx := graphql.WithPathContext(ctx, graphql.NewPathWithField("autoInstrument")) + data, err := ec.unmarshalOBoolean2ᚖbool(ctx, v) + if err != nil { + return it, err + } + it.AutoInstrument = data + } + } + + return it, nil +} + +func (ec *executionContext) unmarshalInputK8sNamespaceId(ctx context.Context, obj interface{}) (model.K8sNamespaceID, error) { + var it model.K8sNamespaceID + asMap := map[string]interface{}{} + for k, v := range obj.(map[string]interface{}) { + asMap[k] = v + } + + fieldsInOrder := [...]string{"name"} + for _, k := range fieldsInOrder { + v, ok := asMap[k] + if !ok { + continue + } + switch k { + case "name": + ctx := graphql.WithPathContext(ctx, graphql.NewPathWithField("name")) + data, err := ec.unmarshalNString2string(ctx, v) + if err != nil { + return it, err + } + it.Name = data + } + } + + return it, nil +} + +func (ec *executionContext) unmarshalInputK8sSourceId(ctx context.Context, obj interface{}) (model.K8sSourceID, error) { + var it model.K8sSourceID + asMap := map[string]interface{}{} + for k, v := range obj.(map[string]interface{}) { + asMap[k] = v + } + + fieldsInOrder := [...]string{"namespace", "kind", "name"} + for _, k := range fieldsInOrder { + v, ok := asMap[k] + if !ok { + continue + } + switch k { + case "namespace": + ctx := graphql.WithPathContext(ctx, graphql.NewPathWithField("namespace")) + data, err := ec.unmarshalNString2string(ctx, v) + if err != nil { + return it, err + } + it.Namespace = data + case "kind": + ctx := graphql.WithPathContext(ctx, graphql.NewPathWithField("kind")) + data, err := ec.unmarshalNK8sResourceKind2githubᚗcomᚋodigosᚑioᚋodigosᚋfrontendᚋgraphᚋmodelᚐK8sResourceKind(ctx, v) + if err != nil { + return it, err + } + it.Kind = data + case "name": + ctx := graphql.WithPathContext(ctx, graphql.NewPathWithField("name")) + data, err := ec.unmarshalNString2string(ctx, v) + if err != nil { + return it, err + } + it.Name = data + } + } + + return it, nil +} + +func (ec *executionContext) unmarshalInputPatchSourceRequestInput(ctx context.Context, obj interface{}) (model.PatchSourceRequestInput, error) { + var it model.PatchSourceRequestInput + asMap := map[string]interface{}{} + for k, v := range obj.(map[string]interface{}) { + asMap[k] = v + } + + fieldsInOrder := [...]string{"reportedName"} + for _, k := range fieldsInOrder { + v, ok := asMap[k] + if !ok { + continue + } + switch k { + case "reportedName": + ctx := graphql.WithPathContext(ctx, graphql.NewPathWithField("reportedName")) + data, err := ec.unmarshalOString2ᚖstring(ctx, v) + if err != nil { + return it, err + } + it.ReportedName = data + } + } + + return it, nil +} + +func (ec *executionContext) unmarshalInputPersistNamespaceItemInput(ctx context.Context, obj interface{}) (model.PersistNamespaceItemInput, error) { + var it model.PersistNamespaceItemInput + asMap := map[string]interface{}{} + for k, v := range obj.(map[string]interface{}) { + asMap[k] = v + } + + fieldsInOrder := [...]string{"name", "futureSelected"} + for _, k := range fieldsInOrder { + v, ok := asMap[k] + if !ok { + continue + } + switch k { + case "name": + ctx := graphql.WithPathContext(ctx, graphql.NewPathWithField("name")) + data, err := ec.unmarshalNString2string(ctx, v) + if err != nil { + return it, err + } + it.Name = data + case "futureSelected": + ctx := graphql.WithPathContext(ctx, graphql.NewPathWithField("futureSelected")) + data, err := ec.unmarshalOBoolean2ᚖbool(ctx, v) + if err != nil { + return it, err + } + it.FutureSelected = data + } + } + + return it, nil +} + +func (ec *executionContext) unmarshalInputPersistNamespaceSourceInput(ctx context.Context, obj interface{}) (model.PersistNamespaceSourceInput, error) { + var it model.PersistNamespaceSourceInput + asMap := map[string]interface{}{} + for k, v := range obj.(map[string]interface{}) { + asMap[k] = v + } + + fieldsInOrder := [...]string{"name", "kind", "selected"} + for _, k := range fieldsInOrder { + v, ok := asMap[k] + if !ok { + continue + } + switch k { + case "name": + ctx := graphql.WithPathContext(ctx, graphql.NewPathWithField("name")) + data, err := ec.unmarshalNString2string(ctx, v) + if err != nil { + return it, err + } + it.Name = data + case "kind": + ctx := graphql.WithPathContext(ctx, graphql.NewPathWithField("kind")) + data, err := ec.unmarshalNK8sResourceKind2githubᚗcomᚋodigosᚑioᚋodigosᚋfrontendᚋgraphᚋmodelᚐK8sResourceKind(ctx, v) + if err != nil { + return it, err + } + it.Kind = data + case "selected": + ctx := graphql.WithPathContext(ctx, graphql.NewPathWithField("selected")) + data, err := ec.unmarshalOBoolean2ᚖbool(ctx, v) + if err != nil { + return it, err + } + it.Selected = data + } + } + + return it, nil +} + +// endregion **************************** input.gotpl ***************************** + +// region ************************** interface.gotpl *************************** + +// endregion ************************** interface.gotpl *************************** + +// region **************************** object.gotpl **************************** + +var computePlatformImplementors = []string{"ComputePlatform"} + +func (ec *executionContext) _ComputePlatform(ctx context.Context, sel ast.SelectionSet, obj *model.ComputePlatform) graphql.Marshaler { + fields := graphql.CollectFields(ec.OperationContext, sel, computePlatformImplementors) + + out := graphql.NewFieldSet(fields) + deferred := make(map[string]*graphql.FieldSet) + for i, field := range fields { + switch field.Name { + case "__typename": + out.Values[i] = graphql.MarshalString("ComputePlatform") + case "computePlatformType": + out.Values[i] = ec._ComputePlatform_computePlatformType(ctx, field, obj) + if out.Values[i] == graphql.Null { + atomic.AddUint32(&out.Invalids, 1) + } + case "k8sActualNamespace": + field := field + + innerFunc := func(ctx context.Context, _ *graphql.FieldSet) (res graphql.Marshaler) { + defer func() { + if r := recover(); r != nil { + ec.Error(ctx, ec.Recover(ctx, r)) + } + }() + res = ec._ComputePlatform_k8sActualNamespace(ctx, field, obj) + return res + } + + if field.Deferrable != nil { + dfs, ok := deferred[field.Deferrable.Label] + di := 0 + if ok { + dfs.AddField(field) + di = len(dfs.Values) - 1 + } else { + dfs = graphql.NewFieldSet([]graphql.CollectedField{field}) + deferred[field.Deferrable.Label] = dfs + } + dfs.Concurrently(di, func(ctx context.Context) graphql.Marshaler { + return innerFunc(ctx, dfs) + }) + + // don't run the out.Concurrently() call below + out.Values[i] = graphql.Null + continue + } + + out.Concurrently(i, func(ctx context.Context) graphql.Marshaler { return innerFunc(ctx, out) }) + case "k8sActualNamespaces": + field := field + + innerFunc := func(ctx context.Context, fs *graphql.FieldSet) (res graphql.Marshaler) { + defer func() { + if r := recover(); r != nil { + ec.Error(ctx, ec.Recover(ctx, r)) + } + }() + res = ec._ComputePlatform_k8sActualNamespaces(ctx, field, obj) + if res == graphql.Null { + atomic.AddUint32(&fs.Invalids, 1) + } + return res + } + + if field.Deferrable != nil { + dfs, ok := deferred[field.Deferrable.Label] + di := 0 + if ok { + dfs.AddField(field) + di = len(dfs.Values) - 1 + } else { + dfs = graphql.NewFieldSet([]graphql.CollectedField{field}) + deferred[field.Deferrable.Label] = dfs + } + dfs.Concurrently(di, func(ctx context.Context) graphql.Marshaler { + return innerFunc(ctx, dfs) + }) + + // don't run the out.Concurrently() call below + out.Values[i] = graphql.Null + continue + } + + out.Concurrently(i, func(ctx context.Context) graphql.Marshaler { return innerFunc(ctx, out) }) + case "k8sActualSource": + field := field + + innerFunc := func(ctx context.Context, _ *graphql.FieldSet) (res graphql.Marshaler) { + defer func() { + if r := recover(); r != nil { + ec.Error(ctx, ec.Recover(ctx, r)) + } + }() + res = ec._ComputePlatform_k8sActualSource(ctx, field, obj) + return res + } + + if field.Deferrable != nil { + dfs, ok := deferred[field.Deferrable.Label] + di := 0 + if ok { + dfs.AddField(field) + di = len(dfs.Values) - 1 + } else { + dfs = graphql.NewFieldSet([]graphql.CollectedField{field}) + deferred[field.Deferrable.Label] = dfs + } + dfs.Concurrently(di, func(ctx context.Context) graphql.Marshaler { + return innerFunc(ctx, dfs) + }) + + // don't run the out.Concurrently() call below + out.Values[i] = graphql.Null + continue + } + + out.Concurrently(i, func(ctx context.Context) graphql.Marshaler { return innerFunc(ctx, out) }) + case "k8sActualSources": + field := field + + innerFunc := func(ctx context.Context, fs *graphql.FieldSet) (res graphql.Marshaler) { + defer func() { + if r := recover(); r != nil { + ec.Error(ctx, ec.Recover(ctx, r)) + } + }() + res = ec._ComputePlatform_k8sActualSources(ctx, field, obj) + if res == graphql.Null { + atomic.AddUint32(&fs.Invalids, 1) + } + return res + } + + if field.Deferrable != nil { + dfs, ok := deferred[field.Deferrable.Label] + di := 0 + if ok { + dfs.AddField(field) + di = len(dfs.Values) - 1 + } else { + dfs = graphql.NewFieldSet([]graphql.CollectedField{field}) + deferred[field.Deferrable.Label] = dfs + } + dfs.Concurrently(di, func(ctx context.Context) graphql.Marshaler { + return innerFunc(ctx, dfs) + }) + + // don't run the out.Concurrently() call below + out.Values[i] = graphql.Null + continue + } + + out.Concurrently(i, func(ctx context.Context) graphql.Marshaler { return innerFunc(ctx, out) }) + case "destinations": + field := field + + innerFunc := func(ctx context.Context, fs *graphql.FieldSet) (res graphql.Marshaler) { + defer func() { + if r := recover(); r != nil { + ec.Error(ctx, ec.Recover(ctx, r)) + } + }() + res = ec._ComputePlatform_destinations(ctx, field, obj) + if res == graphql.Null { + atomic.AddUint32(&fs.Invalids, 1) + } + return res + } + + if field.Deferrable != nil { + dfs, ok := deferred[field.Deferrable.Label] + di := 0 + if ok { + dfs.AddField(field) + di = len(dfs.Values) - 1 + } else { + dfs = graphql.NewFieldSet([]graphql.CollectedField{field}) + deferred[field.Deferrable.Label] = dfs + } + dfs.Concurrently(di, func(ctx context.Context) graphql.Marshaler { + return innerFunc(ctx, dfs) + }) + + // don't run the out.Concurrently() call below + out.Values[i] = graphql.Null + continue + } + + out.Concurrently(i, func(ctx context.Context) graphql.Marshaler { return innerFunc(ctx, out) }) + case "actions": + field := field + + innerFunc := func(ctx context.Context, fs *graphql.FieldSet) (res graphql.Marshaler) { + defer func() { + if r := recover(); r != nil { + ec.Error(ctx, ec.Recover(ctx, r)) + } + }() + res = ec._ComputePlatform_actions(ctx, field, obj) + if res == graphql.Null { + atomic.AddUint32(&fs.Invalids, 1) + } + return res + } + + if field.Deferrable != nil { + dfs, ok := deferred[field.Deferrable.Label] + di := 0 + if ok { + dfs.AddField(field) + di = len(dfs.Values) - 1 + } else { + dfs = graphql.NewFieldSet([]graphql.CollectedField{field}) + deferred[field.Deferrable.Label] = dfs + } + dfs.Concurrently(di, func(ctx context.Context) graphql.Marshaler { + return innerFunc(ctx, dfs) + }) + + // don't run the out.Concurrently() call below + out.Values[i] = graphql.Null + continue + } + + out.Concurrently(i, func(ctx context.Context) graphql.Marshaler { return innerFunc(ctx, out) }) + default: + panic("unknown field " + strconv.Quote(field.Name)) + } + } + out.Dispatch(ctx) + if out.Invalids > 0 { + return graphql.Null + } + + atomic.AddInt32(&ec.deferred, int32(len(deferred))) + + for label, dfs := range deferred { + ec.processDeferredGroup(graphql.DeferredGroup{ + Label: label, + Path: graphql.GetPath(ctx), + FieldSet: dfs, + Context: ctx, + }) + } + + return out +} + +var conditionImplementors = []string{"Condition"} + +func (ec *executionContext) _Condition(ctx context.Context, sel ast.SelectionSet, obj *model.Condition) graphql.Marshaler { + fields := graphql.CollectFields(ec.OperationContext, sel, conditionImplementors) + + out := graphql.NewFieldSet(fields) + deferred := make(map[string]*graphql.FieldSet) + for i, field := range fields { + switch field.Name { + case "__typename": + out.Values[i] = graphql.MarshalString("Condition") + case "type": + out.Values[i] = ec._Condition_type(ctx, field, obj) + if out.Values[i] == graphql.Null { + out.Invalids++ + } + case "status": + out.Values[i] = ec._Condition_status(ctx, field, obj) + if out.Values[i] == graphql.Null { + out.Invalids++ + } + case "lastTransitionTime": + out.Values[i] = ec._Condition_lastTransitionTime(ctx, field, obj) + case "reason": + out.Values[i] = ec._Condition_reason(ctx, field, obj) + case "message": + out.Values[i] = ec._Condition_message(ctx, field, obj) + default: + panic("unknown field " + strconv.Quote(field.Name)) + } + } + out.Dispatch(ctx) + if out.Invalids > 0 { + return graphql.Null + } + + atomic.AddInt32(&ec.deferred, int32(len(deferred))) + + for label, dfs := range deferred { + ec.processDeferredGroup(graphql.DeferredGroup{ + Label: label, + Path: graphql.GetPath(ctx), + FieldSet: dfs, + Context: ctx, + }) + } + + return out +} + +var destinationImplementors = []string{"Destination"} + +func (ec *executionContext) _Destination(ctx context.Context, sel ast.SelectionSet, obj *model.Destination) graphql.Marshaler { + fields := graphql.CollectFields(ec.OperationContext, sel, destinationImplementors) + + out := graphql.NewFieldSet(fields) + deferred := make(map[string]*graphql.FieldSet) + for i, field := range fields { + switch field.Name { + case "__typename": + out.Values[i] = graphql.MarshalString("Destination") + case "id": + out.Values[i] = ec._Destination_id(ctx, field, obj) + if out.Values[i] == graphql.Null { + atomic.AddUint32(&out.Invalids, 1) + } + case "name": + out.Values[i] = ec._Destination_name(ctx, field, obj) + if out.Values[i] == graphql.Null { + atomic.AddUint32(&out.Invalids, 1) + } + case "type": + field := field + + innerFunc := func(ctx context.Context, fs *graphql.FieldSet) (res graphql.Marshaler) { + defer func() { + if r := recover(); r != nil { + ec.Error(ctx, ec.Recover(ctx, r)) + } + }() + res = ec._Destination_type(ctx, field, obj) + if res == graphql.Null { + atomic.AddUint32(&fs.Invalids, 1) + } + return res + } + + if field.Deferrable != nil { + dfs, ok := deferred[field.Deferrable.Label] + di := 0 + if ok { + dfs.AddField(field) + di = len(dfs.Values) - 1 + } else { + dfs = graphql.NewFieldSet([]graphql.CollectedField{field}) + deferred[field.Deferrable.Label] = dfs + } + dfs.Concurrently(di, func(ctx context.Context) graphql.Marshaler { + return innerFunc(ctx, dfs) + }) + + // don't run the out.Concurrently() call below + out.Values[i] = graphql.Null + continue + } + + out.Concurrently(i, func(ctx context.Context) graphql.Marshaler { return innerFunc(ctx, out) }) + case "exportedSignals": + out.Values[i] = ec._Destination_exportedSignals(ctx, field, obj) + if out.Values[i] == graphql.Null { + atomic.AddUint32(&out.Invalids, 1) + } + case "fields": + out.Values[i] = ec._Destination_fields(ctx, field, obj) + if out.Values[i] == graphql.Null { + atomic.AddUint32(&out.Invalids, 1) + } + case "destinationType": + out.Values[i] = ec._Destination_destinationType(ctx, field, obj) + if out.Values[i] == graphql.Null { + atomic.AddUint32(&out.Invalids, 1) + } + case "conditions": + field := field + + innerFunc := func(ctx context.Context, _ *graphql.FieldSet) (res graphql.Marshaler) { + defer func() { + if r := recover(); r != nil { + ec.Error(ctx, ec.Recover(ctx, r)) + } + }() + res = ec._Destination_conditions(ctx, field, obj) + return res + } + + if field.Deferrable != nil { + dfs, ok := deferred[field.Deferrable.Label] + di := 0 + if ok { + dfs.AddField(field) + di = len(dfs.Values) - 1 + } else { + dfs = graphql.NewFieldSet([]graphql.CollectedField{field}) + deferred[field.Deferrable.Label] = dfs + } + dfs.Concurrently(di, func(ctx context.Context) graphql.Marshaler { + return innerFunc(ctx, dfs) + }) + + // don't run the out.Concurrently() call below + out.Values[i] = graphql.Null + continue + } + + out.Concurrently(i, func(ctx context.Context) graphql.Marshaler { return innerFunc(ctx, out) }) + default: + panic("unknown field " + strconv.Quote(field.Name)) + } + } + out.Dispatch(ctx) + if out.Invalids > 0 { + return graphql.Null + } + + atomic.AddInt32(&ec.deferred, int32(len(deferred))) + + for label, dfs := range deferred { + ec.processDeferredGroup(graphql.DeferredGroup{ + Label: label, + Path: graphql.GetPath(ctx), + FieldSet: dfs, + Context: ctx, + }) + } + + return out +} + +var destinationDetailsImplementors = []string{"DestinationDetails"} + +func (ec *executionContext) _DestinationDetails(ctx context.Context, sel ast.SelectionSet, obj *model.DestinationDetails) graphql.Marshaler { + fields := graphql.CollectFields(ec.OperationContext, sel, destinationDetailsImplementors) + + out := graphql.NewFieldSet(fields) + deferred := make(map[string]*graphql.FieldSet) + for i, field := range fields { + switch field.Name { + case "__typename": + out.Values[i] = graphql.MarshalString("DestinationDetails") + case "type": + out.Values[i] = ec._DestinationDetails_type(ctx, field, obj) + if out.Values[i] == graphql.Null { + out.Invalids++ + } + case "urlString": + out.Values[i] = ec._DestinationDetails_urlString(ctx, field, obj) + if out.Values[i] == graphql.Null { + out.Invalids++ + } + case "fields": + out.Values[i] = ec._DestinationDetails_fields(ctx, field, obj) + if out.Values[i] == graphql.Null { + out.Invalids++ + } + default: + panic("unknown field " + strconv.Quote(field.Name)) + } + } + out.Dispatch(ctx) + if out.Invalids > 0 { + return graphql.Null + } + + atomic.AddInt32(&ec.deferred, int32(len(deferred))) + + for label, dfs := range deferred { + ec.processDeferredGroup(graphql.DeferredGroup{ + Label: label, + Path: graphql.GetPath(ctx), + FieldSet: dfs, + Context: ctx, + }) + } + + return out +} + +var destinationTypesCategoryItemImplementors = []string{"DestinationTypesCategoryItem"} + +func (ec *executionContext) _DestinationTypesCategoryItem(ctx context.Context, sel ast.SelectionSet, obj *model.DestinationTypesCategoryItem) graphql.Marshaler { + fields := graphql.CollectFields(ec.OperationContext, sel, destinationTypesCategoryItemImplementors) + + out := graphql.NewFieldSet(fields) + deferred := make(map[string]*graphql.FieldSet) + for i, field := range fields { + switch field.Name { + case "__typename": + out.Values[i] = graphql.MarshalString("DestinationTypesCategoryItem") + case "type": + out.Values[i] = ec._DestinationTypesCategoryItem_type(ctx, field, obj) + if out.Values[i] == graphql.Null { + out.Invalids++ + } + case "displayName": + out.Values[i] = ec._DestinationTypesCategoryItem_displayName(ctx, field, obj) + if out.Values[i] == graphql.Null { + out.Invalids++ + } + case "imageUrl": + out.Values[i] = ec._DestinationTypesCategoryItem_imageUrl(ctx, field, obj) + if out.Values[i] == graphql.Null { + out.Invalids++ + } + case "supportedSignals": + out.Values[i] = ec._DestinationTypesCategoryItem_supportedSignals(ctx, field, obj) + if out.Values[i] == graphql.Null { + out.Invalids++ + } + case "testConnectionSupported": + out.Values[i] = ec._DestinationTypesCategoryItem_testConnectionSupported(ctx, field, obj) + if out.Values[i] == graphql.Null { + out.Invalids++ + } + default: + panic("unknown field " + strconv.Quote(field.Name)) + } + } + out.Dispatch(ctx) + if out.Invalids > 0 { + return graphql.Null + } + + atomic.AddInt32(&ec.deferred, int32(len(deferred))) + + for label, dfs := range deferred { + ec.processDeferredGroup(graphql.DeferredGroup{ + Label: label, + Path: graphql.GetPath(ctx), + FieldSet: dfs, + Context: ctx, + }) + } + + return out +} + +var destinationsCategoryImplementors = []string{"DestinationsCategory"} + +func (ec *executionContext) _DestinationsCategory(ctx context.Context, sel ast.SelectionSet, obj *model.DestinationsCategory) graphql.Marshaler { + fields := graphql.CollectFields(ec.OperationContext, sel, destinationsCategoryImplementors) + + out := graphql.NewFieldSet(fields) + deferred := make(map[string]*graphql.FieldSet) + for i, field := range fields { + switch field.Name { + case "__typename": + out.Values[i] = graphql.MarshalString("DestinationsCategory") + case "name": + out.Values[i] = ec._DestinationsCategory_name(ctx, field, obj) + if out.Values[i] == graphql.Null { + out.Invalids++ + } + case "items": + out.Values[i] = ec._DestinationsCategory_items(ctx, field, obj) + if out.Values[i] == graphql.Null { + out.Invalids++ + } + default: + panic("unknown field " + strconv.Quote(field.Name)) + } + } + out.Dispatch(ctx) + if out.Invalids > 0 { + return graphql.Null + } + + atomic.AddInt32(&ec.deferred, int32(len(deferred))) + + for label, dfs := range deferred { + ec.processDeferredGroup(graphql.DeferredGroup{ + Label: label, + Path: graphql.GetPath(ctx), + FieldSet: dfs, + Context: ctx, + }) + } + + return out +} + +var exportedSignalsImplementors = []string{"ExportedSignals"} + +func (ec *executionContext) _ExportedSignals(ctx context.Context, sel ast.SelectionSet, obj *model.ExportedSignals) graphql.Marshaler { + fields := graphql.CollectFields(ec.OperationContext, sel, exportedSignalsImplementors) + + out := graphql.NewFieldSet(fields) + deferred := make(map[string]*graphql.FieldSet) + for i, field := range fields { + switch field.Name { + case "__typename": + out.Values[i] = graphql.MarshalString("ExportedSignals") + case "traces": + out.Values[i] = ec._ExportedSignals_traces(ctx, field, obj) + if out.Values[i] == graphql.Null { + out.Invalids++ + } + case "metrics": + out.Values[i] = ec._ExportedSignals_metrics(ctx, field, obj) + if out.Values[i] == graphql.Null { + out.Invalids++ + } + case "logs": + out.Values[i] = ec._ExportedSignals_logs(ctx, field, obj) + if out.Values[i] == graphql.Null { + out.Invalids++ + } + default: + panic("unknown field " + strconv.Quote(field.Name)) + } + } + out.Dispatch(ctx) + if out.Invalids > 0 { + return graphql.Null + } + + atomic.AddInt32(&ec.deferred, int32(len(deferred))) + + for label, dfs := range deferred { + ec.processDeferredGroup(graphql.DeferredGroup{ + Label: label, + Path: graphql.GetPath(ctx), + FieldSet: dfs, + Context: ctx, + }) + } + + return out +} + +var fieldImplementors = []string{"Field"} + +func (ec *executionContext) _Field(ctx context.Context, sel ast.SelectionSet, obj *model.Field) graphql.Marshaler { + fields := graphql.CollectFields(ec.OperationContext, sel, fieldImplementors) + + out := graphql.NewFieldSet(fields) + deferred := make(map[string]*graphql.FieldSet) + for i, field := range fields { + switch field.Name { + case "__typename": + out.Values[i] = graphql.MarshalString("Field") + case "name": + out.Values[i] = ec._Field_name(ctx, field, obj) + if out.Values[i] == graphql.Null { + out.Invalids++ + } + case "displayName": + out.Values[i] = ec._Field_displayName(ctx, field, obj) + if out.Values[i] == graphql.Null { + out.Invalids++ + } + case "componentType": + out.Values[i] = ec._Field_componentType(ctx, field, obj) + if out.Values[i] == graphql.Null { + out.Invalids++ + } + case "componentProperties": + out.Values[i] = ec._Field_componentProperties(ctx, field, obj) + if out.Values[i] == graphql.Null { + out.Invalids++ + } + case "videoUrl": + out.Values[i] = ec._Field_videoUrl(ctx, field, obj) + case "thumbnailURL": + out.Values[i] = ec._Field_thumbnailURL(ctx, field, obj) + case "initialValue": + out.Values[i] = ec._Field_initialValue(ctx, field, obj) + default: + panic("unknown field " + strconv.Quote(field.Name)) + } + } + out.Dispatch(ctx) + if out.Invalids > 0 { + return graphql.Null + } + + atomic.AddInt32(&ec.deferred, int32(len(deferred))) + + for label, dfs := range deferred { + ec.processDeferredGroup(graphql.DeferredGroup{ + Label: label, + Path: graphql.GetPath(ctx), + FieldSet: dfs, + Context: ctx, + }) + } + + return out +} + +var getConfigResponseImplementors = []string{"GetConfigResponse"} + +func (ec *executionContext) _GetConfigResponse(ctx context.Context, sel ast.SelectionSet, obj *model.GetConfigResponse) graphql.Marshaler { + fields := graphql.CollectFields(ec.OperationContext, sel, getConfigResponseImplementors) + + out := graphql.NewFieldSet(fields) + deferred := make(map[string]*graphql.FieldSet) + for i, field := range fields { + switch field.Name { + case "__typename": + out.Values[i] = graphql.MarshalString("GetConfigResponse") + case "installation": + out.Values[i] = ec._GetConfigResponse_installation(ctx, field, obj) + if out.Values[i] == graphql.Null { + out.Invalids++ + } + default: + panic("unknown field " + strconv.Quote(field.Name)) + } + } + out.Dispatch(ctx) + if out.Invalids > 0 { + return graphql.Null + } + + atomic.AddInt32(&ec.deferred, int32(len(deferred))) + + for label, dfs := range deferred { + ec.processDeferredGroup(graphql.DeferredGroup{ + Label: label, + Path: graphql.GetPath(ctx), + FieldSet: dfs, + Context: ctx, + }) + } + + return out +} + +var getDestinationDetailsResponseImplementors = []string{"GetDestinationDetailsResponse"} + +func (ec *executionContext) _GetDestinationDetailsResponse(ctx context.Context, sel ast.SelectionSet, obj *model.GetDestinationDetailsResponse) graphql.Marshaler { + fields := graphql.CollectFields(ec.OperationContext, sel, getDestinationDetailsResponseImplementors) + + out := graphql.NewFieldSet(fields) + deferred := make(map[string]*graphql.FieldSet) + for i, field := range fields { + switch field.Name { + case "__typename": + out.Values[i] = graphql.MarshalString("GetDestinationDetailsResponse") + case "fields": + out.Values[i] = ec._GetDestinationDetailsResponse_fields(ctx, field, obj) + if out.Values[i] == graphql.Null { + out.Invalids++ + } + default: + panic("unknown field " + strconv.Quote(field.Name)) + } + } + out.Dispatch(ctx) + if out.Invalids > 0 { + return graphql.Null + } + + atomic.AddInt32(&ec.deferred, int32(len(deferred))) + + for label, dfs := range deferred { + ec.processDeferredGroup(graphql.DeferredGroup{ + Label: label, + Path: graphql.GetPath(ctx), + FieldSet: dfs, + Context: ctx, + }) + } + + return out +} + +var getDestinationTypesResponseImplementors = []string{"GetDestinationTypesResponse"} + +func (ec *executionContext) _GetDestinationTypesResponse(ctx context.Context, sel ast.SelectionSet, obj *model.GetDestinationTypesResponse) graphql.Marshaler { + fields := graphql.CollectFields(ec.OperationContext, sel, getDestinationTypesResponseImplementors) + + out := graphql.NewFieldSet(fields) + deferred := make(map[string]*graphql.FieldSet) + for i, field := range fields { + switch field.Name { + case "__typename": + out.Values[i] = graphql.MarshalString("GetDestinationTypesResponse") + case "categories": + out.Values[i] = ec._GetDestinationTypesResponse_categories(ctx, field, obj) + if out.Values[i] == graphql.Null { + out.Invalids++ + } + default: + panic("unknown field " + strconv.Quote(field.Name)) + } + } + out.Dispatch(ctx) + if out.Invalids > 0 { + return graphql.Null + } + + atomic.AddInt32(&ec.deferred, int32(len(deferred))) + + for label, dfs := range deferred { + ec.processDeferredGroup(graphql.DeferredGroup{ + Label: label, + Path: graphql.GetPath(ctx), + FieldSet: dfs, + Context: ctx, + }) + } + + return out +} + +var icaInstanceResponseImplementors = []string{"IcaInstanceResponse"} + +func (ec *executionContext) _IcaInstanceResponse(ctx context.Context, sel ast.SelectionSet, obj *model.IcaInstanceResponse) graphql.Marshaler { + fields := graphql.CollectFields(ec.OperationContext, sel, icaInstanceResponseImplementors) + + out := graphql.NewFieldSet(fields) + deferred := make(map[string]*graphql.FieldSet) + for i, field := range fields { + switch field.Name { + case "__typename": + out.Values[i] = graphql.MarshalString("IcaInstanceResponse") + case "id": + out.Values[i] = ec._IcaInstanceResponse_id(ctx, field, obj) + if out.Values[i] == graphql.Null { + out.Invalids++ + } + case "type": + out.Values[i] = ec._IcaInstanceResponse_type(ctx, field, obj) + if out.Values[i] == graphql.Null { + out.Invalids++ + } + case "spec": + out.Values[i] = ec._IcaInstanceResponse_spec(ctx, field, obj) + if out.Values[i] == graphql.Null { + out.Invalids++ + } + default: + panic("unknown field " + strconv.Quote(field.Name)) + } + } + out.Dispatch(ctx) + if out.Invalids > 0 { + return graphql.Null + } + + atomic.AddInt32(&ec.deferred, int32(len(deferred))) + + for label, dfs := range deferred { + ec.processDeferredGroup(graphql.DeferredGroup{ + Label: label, + Path: graphql.GetPath(ctx), + FieldSet: dfs, + Context: ctx, + }) + } + + return out +} + +var instrumentationLibraryImplementors = []string{"InstrumentationLibrary"} + +func (ec *executionContext) _InstrumentationLibrary(ctx context.Context, sel ast.SelectionSet, obj *model.InstrumentationLibrary) graphql.Marshaler { + fields := graphql.CollectFields(ec.OperationContext, sel, instrumentationLibraryImplementors) + + out := graphql.NewFieldSet(fields) + deferred := make(map[string]*graphql.FieldSet) + for i, field := range fields { + switch field.Name { + case "__typename": + out.Values[i] = graphql.MarshalString("InstrumentationLibrary") + case "libraryName": + out.Values[i] = ec._InstrumentationLibrary_libraryName(ctx, field, obj) + if out.Values[i] == graphql.Null { + out.Invalids++ + } + case "options": + out.Values[i] = ec._InstrumentationLibrary_options(ctx, field, obj) + if out.Values[i] == graphql.Null { + out.Invalids++ + } + default: + panic("unknown field " + strconv.Quote(field.Name)) + } + } + out.Dispatch(ctx) + if out.Invalids > 0 { + return graphql.Null + } + + atomic.AddInt32(&ec.deferred, int32(len(deferred))) + + for label, dfs := range deferred { + ec.processDeferredGroup(graphql.DeferredGroup{ + Label: label, + Path: graphql.GetPath(ctx), + FieldSet: dfs, + Context: ctx, + }) + } + + return out +} + +var instrumentationOptionImplementors = []string{"InstrumentationOption"} + +func (ec *executionContext) _InstrumentationOption(ctx context.Context, sel ast.SelectionSet, obj *model.InstrumentationOption) graphql.Marshaler { + fields := graphql.CollectFields(ec.OperationContext, sel, instrumentationOptionImplementors) + + out := graphql.NewFieldSet(fields) + deferred := make(map[string]*graphql.FieldSet) + for i, field := range fields { + switch field.Name { + case "__typename": + out.Values[i] = graphql.MarshalString("InstrumentationOption") + case "optionKey": + out.Values[i] = ec._InstrumentationOption_optionKey(ctx, field, obj) + if out.Values[i] == graphql.Null { + out.Invalids++ + } + case "spanKind": + out.Values[i] = ec._InstrumentationOption_spanKind(ctx, field, obj) + if out.Values[i] == graphql.Null { + out.Invalids++ + } + default: + panic("unknown field " + strconv.Quote(field.Name)) + } + } + out.Dispatch(ctx) + if out.Invalids > 0 { + return graphql.Null + } + + atomic.AddInt32(&ec.deferred, int32(len(deferred))) + + for label, dfs := range deferred { + ec.processDeferredGroup(graphql.DeferredGroup{ + Label: label, + Path: graphql.GetPath(ctx), + FieldSet: dfs, + Context: ctx, + }) + } + + return out +} + +var instrumentedApplicationDetailsImplementors = []string{"InstrumentedApplicationDetails"} + +func (ec *executionContext) _InstrumentedApplicationDetails(ctx context.Context, sel ast.SelectionSet, obj *model.InstrumentedApplicationDetails) graphql.Marshaler { + fields := graphql.CollectFields(ec.OperationContext, sel, instrumentedApplicationDetailsImplementors) + + out := graphql.NewFieldSet(fields) + deferred := make(map[string]*graphql.FieldSet) + for i, field := range fields { + switch field.Name { + case "__typename": + out.Values[i] = graphql.MarshalString("InstrumentedApplicationDetails") + case "containers": + out.Values[i] = ec._InstrumentedApplicationDetails_containers(ctx, field, obj) + case "conditions": + out.Values[i] = ec._InstrumentedApplicationDetails_conditions(ctx, field, obj) + case "instrumentationOptions": + out.Values[i] = ec._InstrumentedApplicationDetails_instrumentationOptions(ctx, field, obj) + if out.Values[i] == graphql.Null { + out.Invalids++ + } + default: + panic("unknown field " + strconv.Quote(field.Name)) + } + } + out.Dispatch(ctx) + if out.Invalids > 0 { + return graphql.Null + } + + atomic.AddInt32(&ec.deferred, int32(len(deferred))) + + for label, dfs := range deferred { + ec.processDeferredGroup(graphql.DeferredGroup{ + Label: label, + Path: graphql.GetPath(ctx), + FieldSet: dfs, + Context: ctx, + }) + } + + return out +} + +var k8sActualNamespaceImplementors = []string{"K8sActualNamespace"} + +func (ec *executionContext) _K8sActualNamespace(ctx context.Context, sel ast.SelectionSet, obj *model.K8sActualNamespace) graphql.Marshaler { + fields := graphql.CollectFields(ec.OperationContext, sel, k8sActualNamespaceImplementors) + + out := graphql.NewFieldSet(fields) + deferred := make(map[string]*graphql.FieldSet) + for i, field := range fields { + switch field.Name { + case "__typename": + out.Values[i] = graphql.MarshalString("K8sActualNamespace") + case "name": + out.Values[i] = ec._K8sActualNamespace_name(ctx, field, obj) + if out.Values[i] == graphql.Null { + atomic.AddUint32(&out.Invalids, 1) + } + case "instrumentationLabelEnabled": + out.Values[i] = ec._K8sActualNamespace_instrumentationLabelEnabled(ctx, field, obj) + case "k8sActualSources": + field := field + + innerFunc := func(ctx context.Context, fs *graphql.FieldSet) (res graphql.Marshaler) { + defer func() { + if r := recover(); r != nil { + ec.Error(ctx, ec.Recover(ctx, r)) + } + }() + res = ec._K8sActualNamespace_k8sActualSources(ctx, field, obj) + if res == graphql.Null { + atomic.AddUint32(&fs.Invalids, 1) + } + return res + } + + if field.Deferrable != nil { + dfs, ok := deferred[field.Deferrable.Label] + di := 0 + if ok { + dfs.AddField(field) + di = len(dfs.Values) - 1 + } else { + dfs = graphql.NewFieldSet([]graphql.CollectedField{field}) + deferred[field.Deferrable.Label] = dfs + } + dfs.Concurrently(di, func(ctx context.Context) graphql.Marshaler { + return innerFunc(ctx, dfs) + }) + + // don't run the out.Concurrently() call below + out.Values[i] = graphql.Null + continue + } + + out.Concurrently(i, func(ctx context.Context) graphql.Marshaler { return innerFunc(ctx, out) }) + default: + panic("unknown field " + strconv.Quote(field.Name)) + } + } + out.Dispatch(ctx) + if out.Invalids > 0 { + return graphql.Null + } + + atomic.AddInt32(&ec.deferred, int32(len(deferred))) + + for label, dfs := range deferred { + ec.processDeferredGroup(graphql.DeferredGroup{ + Label: label, + Path: graphql.GetPath(ctx), + FieldSet: dfs, + Context: ctx, + }) + } + + return out +} + +var k8sActualSourceImplementors = []string{"K8sActualSource"} + +func (ec *executionContext) _K8sActualSource(ctx context.Context, sel ast.SelectionSet, obj *model.K8sActualSource) graphql.Marshaler { + fields := graphql.CollectFields(ec.OperationContext, sel, k8sActualSourceImplementors) + + out := graphql.NewFieldSet(fields) + deferred := make(map[string]*graphql.FieldSet) + for i, field := range fields { + switch field.Name { + case "__typename": + out.Values[i] = graphql.MarshalString("K8sActualSource") + case "namespace": + out.Values[i] = ec._K8sActualSource_namespace(ctx, field, obj) + if out.Values[i] == graphql.Null { + out.Invalids++ + } + case "kind": + out.Values[i] = ec._K8sActualSource_kind(ctx, field, obj) + if out.Values[i] == graphql.Null { + out.Invalids++ + } + case "name": + out.Values[i] = ec._K8sActualSource_name(ctx, field, obj) + if out.Values[i] == graphql.Null { + out.Invalids++ + } + case "serviceName": + out.Values[i] = ec._K8sActualSource_serviceName(ctx, field, obj) + case "numberOfInstances": + out.Values[i] = ec._K8sActualSource_numberOfInstances(ctx, field, obj) + case "reportedName": + out.Values[i] = ec._K8sActualSource_reportedName(ctx, field, obj) + case "autoInstrumented": + out.Values[i] = ec._K8sActualSource_autoInstrumented(ctx, field, obj) + if out.Values[i] == graphql.Null { + out.Invalids++ + } + case "autoInstrumentedDecision": + out.Values[i] = ec._K8sActualSource_autoInstrumentedDecision(ctx, field, obj) + if out.Values[i] == graphql.Null { + out.Invalids++ + } + case "instrumentedApplicationDetails": + out.Values[i] = ec._K8sActualSource_instrumentedApplicationDetails(ctx, field, obj) + default: + panic("unknown field " + strconv.Quote(field.Name)) + } + } + out.Dispatch(ctx) + if out.Invalids > 0 { + return graphql.Null + } + + atomic.AddInt32(&ec.deferred, int32(len(deferred))) + + for label, dfs := range deferred { + ec.processDeferredGroup(graphql.DeferredGroup{ + Label: label, + Path: graphql.GetPath(ctx), + FieldSet: dfs, + Context: ctx, + }) + } + + return out +} + +var mutationImplementors = []string{"Mutation"} + +func (ec *executionContext) _Mutation(ctx context.Context, sel ast.SelectionSet) graphql.Marshaler { + fields := graphql.CollectFields(ec.OperationContext, sel, mutationImplementors) + ctx = graphql.WithFieldContext(ctx, &graphql.FieldContext{ + Object: "Mutation", + }) + + out := graphql.NewFieldSet(fields) + deferred := make(map[string]*graphql.FieldSet) + for i, field := range fields { + innerCtx := graphql.WithRootFieldContext(ctx, &graphql.RootFieldContext{ + Object: field.Name, + Field: field, + }) + + switch field.Name { + case "__typename": + out.Values[i] = graphql.MarshalString("Mutation") + case "createNewDestination": + out.Values[i] = ec.OperationContext.RootResolverMiddleware(innerCtx, func(ctx context.Context) (res graphql.Marshaler) { + return ec._Mutation_createNewDestination(ctx, field) + }) + if out.Values[i] == graphql.Null { + out.Invalids++ + } + case "persistK8sNamespace": + out.Values[i] = ec.OperationContext.RootResolverMiddleware(innerCtx, func(ctx context.Context) (res graphql.Marshaler) { + return ec._Mutation_persistK8sNamespace(ctx, field) + }) + if out.Values[i] == graphql.Null { + out.Invalids++ + } + case "persistK8sSources": + out.Values[i] = ec.OperationContext.RootResolverMiddleware(innerCtx, func(ctx context.Context) (res graphql.Marshaler) { + return ec._Mutation_persistK8sSources(ctx, field) + }) + if out.Values[i] == graphql.Null { + out.Invalids++ + } + case "testConnectionForDestination": + out.Values[i] = ec.OperationContext.RootResolverMiddleware(innerCtx, func(ctx context.Context) (res graphql.Marshaler) { + return ec._Mutation_testConnectionForDestination(ctx, field) + }) + if out.Values[i] == graphql.Null { + out.Invalids++ + } + case "updateK8sActualSource": + out.Values[i] = ec.OperationContext.RootResolverMiddleware(innerCtx, func(ctx context.Context) (res graphql.Marshaler) { + return ec._Mutation_updateK8sActualSource(ctx, field) + }) + if out.Values[i] == graphql.Null { + out.Invalids++ + } + case "updateDestination": + out.Values[i] = ec.OperationContext.RootResolverMiddleware(innerCtx, func(ctx context.Context) (res graphql.Marshaler) { + return ec._Mutation_updateDestination(ctx, field) + }) + if out.Values[i] == graphql.Null { + out.Invalids++ + } + default: + panic("unknown field " + strconv.Quote(field.Name)) + } + } + out.Dispatch(ctx) + if out.Invalids > 0 { + return graphql.Null + } + + atomic.AddInt32(&ec.deferred, int32(len(deferred))) + + for label, dfs := range deferred { + ec.processDeferredGroup(graphql.DeferredGroup{ + Label: label, + Path: graphql.GetPath(ctx), + FieldSet: dfs, + Context: ctx, + }) + } + + return out +} + +var observabilitySignalSupportImplementors = []string{"ObservabilitySignalSupport"} + +func (ec *executionContext) _ObservabilitySignalSupport(ctx context.Context, sel ast.SelectionSet, obj *model.ObservabilitySignalSupport) graphql.Marshaler { + fields := graphql.CollectFields(ec.OperationContext, sel, observabilitySignalSupportImplementors) + + out := graphql.NewFieldSet(fields) + deferred := make(map[string]*graphql.FieldSet) + for i, field := range fields { + switch field.Name { + case "__typename": + out.Values[i] = graphql.MarshalString("ObservabilitySignalSupport") + case "supported": + out.Values[i] = ec._ObservabilitySignalSupport_supported(ctx, field, obj) + if out.Values[i] == graphql.Null { + out.Invalids++ + } + default: + panic("unknown field " + strconv.Quote(field.Name)) + } + } + out.Dispatch(ctx) + if out.Invalids > 0 { + return graphql.Null + } + + atomic.AddInt32(&ec.deferred, int32(len(deferred))) + + for label, dfs := range deferred { + ec.processDeferredGroup(graphql.DeferredGroup{ + Label: label, + Path: graphql.GetPath(ctx), + FieldSet: dfs, + Context: ctx, + }) + } + + return out +} + +var queryImplementors = []string{"Query"} + +func (ec *executionContext) _Query(ctx context.Context, sel ast.SelectionSet) graphql.Marshaler { + fields := graphql.CollectFields(ec.OperationContext, sel, queryImplementors) + ctx = graphql.WithFieldContext(ctx, &graphql.FieldContext{ + Object: "Query", + }) + + out := graphql.NewFieldSet(fields) + deferred := make(map[string]*graphql.FieldSet) + for i, field := range fields { + innerCtx := graphql.WithRootFieldContext(ctx, &graphql.RootFieldContext{ + Object: field.Name, + Field: field, + }) + + switch field.Name { + case "__typename": + out.Values[i] = graphql.MarshalString("Query") + case "computePlatform": + field := field + + innerFunc := func(ctx context.Context, _ *graphql.FieldSet) (res graphql.Marshaler) { + defer func() { + if r := recover(); r != nil { + ec.Error(ctx, ec.Recover(ctx, r)) + } + }() + res = ec._Query_computePlatform(ctx, field) + return res + } + + rrm := func(ctx context.Context) graphql.Marshaler { + return ec.OperationContext.RootResolverMiddleware(ctx, + func(ctx context.Context) graphql.Marshaler { return innerFunc(ctx, out) }) + } + + out.Concurrently(i, func(ctx context.Context) graphql.Marshaler { return rrm(innerCtx) }) + case "config": + field := field + + innerFunc := func(ctx context.Context, _ *graphql.FieldSet) (res graphql.Marshaler) { + defer func() { + if r := recover(); r != nil { + ec.Error(ctx, ec.Recover(ctx, r)) + } + }() + res = ec._Query_config(ctx, field) + return res + } + + rrm := func(ctx context.Context) graphql.Marshaler { + return ec.OperationContext.RootResolverMiddleware(ctx, + func(ctx context.Context) graphql.Marshaler { return innerFunc(ctx, out) }) + } + + out.Concurrently(i, func(ctx context.Context) graphql.Marshaler { return rrm(innerCtx) }) + case "destinationTypes": + field := field + + innerFunc := func(ctx context.Context, _ *graphql.FieldSet) (res graphql.Marshaler) { + defer func() { + if r := recover(); r != nil { + ec.Error(ctx, ec.Recover(ctx, r)) + } + }() + res = ec._Query_destinationTypes(ctx, field) + return res + } + + rrm := func(ctx context.Context) graphql.Marshaler { + return ec.OperationContext.RootResolverMiddleware(ctx, + func(ctx context.Context) graphql.Marshaler { return innerFunc(ctx, out) }) + } + + out.Concurrently(i, func(ctx context.Context) graphql.Marshaler { return rrm(innerCtx) }) + case "destinationTypeDetails": + field := field + + innerFunc := func(ctx context.Context, _ *graphql.FieldSet) (res graphql.Marshaler) { + defer func() { + if r := recover(); r != nil { + ec.Error(ctx, ec.Recover(ctx, r)) + } + }() + res = ec._Query_destinationTypeDetails(ctx, field) + return res + } + + rrm := func(ctx context.Context) graphql.Marshaler { + return ec.OperationContext.RootResolverMiddleware(ctx, + func(ctx context.Context) graphql.Marshaler { return innerFunc(ctx, out) }) + } + + out.Concurrently(i, func(ctx context.Context) graphql.Marshaler { return rrm(innerCtx) }) + case "potentialDestinations": + field := field + + innerFunc := func(ctx context.Context, fs *graphql.FieldSet) (res graphql.Marshaler) { + defer func() { + if r := recover(); r != nil { + ec.Error(ctx, ec.Recover(ctx, r)) + } + }() + res = ec._Query_potentialDestinations(ctx, field) + if res == graphql.Null { + atomic.AddUint32(&fs.Invalids, 1) + } + return res + } + + rrm := func(ctx context.Context) graphql.Marshaler { + return ec.OperationContext.RootResolverMiddleware(ctx, + func(ctx context.Context) graphql.Marshaler { return innerFunc(ctx, out) }) + } + + out.Concurrently(i, func(ctx context.Context) graphql.Marshaler { return rrm(innerCtx) }) + case "__type": + out.Values[i] = ec.OperationContext.RootResolverMiddleware(innerCtx, func(ctx context.Context) (res graphql.Marshaler) { + return ec._Query___type(ctx, field) + }) + case "__schema": + out.Values[i] = ec.OperationContext.RootResolverMiddleware(innerCtx, func(ctx context.Context) (res graphql.Marshaler) { + return ec._Query___schema(ctx, field) + }) + default: + panic("unknown field " + strconv.Quote(field.Name)) + } + } + out.Dispatch(ctx) + if out.Invalids > 0 { + return graphql.Null + } + + atomic.AddInt32(&ec.deferred, int32(len(deferred))) + + for label, dfs := range deferred { + ec.processDeferredGroup(graphql.DeferredGroup{ + Label: label, + Path: graphql.GetPath(ctx), + FieldSet: dfs, + Context: ctx, + }) + } + + return out +} + +var sourceContainerRuntimeDetailsImplementors = []string{"SourceContainerRuntimeDetails"} + +func (ec *executionContext) _SourceContainerRuntimeDetails(ctx context.Context, sel ast.SelectionSet, obj *model.SourceContainerRuntimeDetails) graphql.Marshaler { + fields := graphql.CollectFields(ec.OperationContext, sel, sourceContainerRuntimeDetailsImplementors) + + out := graphql.NewFieldSet(fields) + deferred := make(map[string]*graphql.FieldSet) + for i, field := range fields { + switch field.Name { + case "__typename": + out.Values[i] = graphql.MarshalString("SourceContainerRuntimeDetails") + case "containerName": + out.Values[i] = ec._SourceContainerRuntimeDetails_containerName(ctx, field, obj) + if out.Values[i] == graphql.Null { + out.Invalids++ + } + case "language": + out.Values[i] = ec._SourceContainerRuntimeDetails_language(ctx, field, obj) + if out.Values[i] == graphql.Null { + out.Invalids++ + } + default: + panic("unknown field " + strconv.Quote(field.Name)) + } + } + out.Dispatch(ctx) + if out.Invalids > 0 { + return graphql.Null + } + + atomic.AddInt32(&ec.deferred, int32(len(deferred))) + + for label, dfs := range deferred { + ec.processDeferredGroup(graphql.DeferredGroup{ + Label: label, + Path: graphql.GetPath(ctx), + FieldSet: dfs, + Context: ctx, + }) + } + + return out +} + +var supportedSignalsImplementors = []string{"SupportedSignals"} + +func (ec *executionContext) _SupportedSignals(ctx context.Context, sel ast.SelectionSet, obj *model.SupportedSignals) graphql.Marshaler { + fields := graphql.CollectFields(ec.OperationContext, sel, supportedSignalsImplementors) + + out := graphql.NewFieldSet(fields) + deferred := make(map[string]*graphql.FieldSet) + for i, field := range fields { + switch field.Name { + case "__typename": + out.Values[i] = graphql.MarshalString("SupportedSignals") + case "traces": + out.Values[i] = ec._SupportedSignals_traces(ctx, field, obj) + if out.Values[i] == graphql.Null { + out.Invalids++ + } + case "metrics": + out.Values[i] = ec._SupportedSignals_metrics(ctx, field, obj) + if out.Values[i] == graphql.Null { + out.Invalids++ + } + case "logs": + out.Values[i] = ec._SupportedSignals_logs(ctx, field, obj) + if out.Values[i] == graphql.Null { + out.Invalids++ + } + default: + panic("unknown field " + strconv.Quote(field.Name)) + } + } + out.Dispatch(ctx) + if out.Invalids > 0 { + return graphql.Null + } + + atomic.AddInt32(&ec.deferred, int32(len(deferred))) + + for label, dfs := range deferred { + ec.processDeferredGroup(graphql.DeferredGroup{ + Label: label, + Path: graphql.GetPath(ctx), + FieldSet: dfs, + Context: ctx, + }) + } + + return out +} + +var testConnectionResponseImplementors = []string{"TestConnectionResponse"} + +func (ec *executionContext) _TestConnectionResponse(ctx context.Context, sel ast.SelectionSet, obj *model.TestConnectionResponse) graphql.Marshaler { + fields := graphql.CollectFields(ec.OperationContext, sel, testConnectionResponseImplementors) + + out := graphql.NewFieldSet(fields) + deferred := make(map[string]*graphql.FieldSet) + for i, field := range fields { + switch field.Name { + case "__typename": + out.Values[i] = graphql.MarshalString("TestConnectionResponse") + case "succeeded": + out.Values[i] = ec._TestConnectionResponse_succeeded(ctx, field, obj) + if out.Values[i] == graphql.Null { + out.Invalids++ + } + case "statusCode": + out.Values[i] = ec._TestConnectionResponse_statusCode(ctx, field, obj) + if out.Values[i] == graphql.Null { + out.Invalids++ + } + case "destinationType": + out.Values[i] = ec._TestConnectionResponse_destinationType(ctx, field, obj) + case "message": + out.Values[i] = ec._TestConnectionResponse_message(ctx, field, obj) + case "reason": + out.Values[i] = ec._TestConnectionResponse_reason(ctx, field, obj) + default: + panic("unknown field " + strconv.Quote(field.Name)) + } + } + out.Dispatch(ctx) + if out.Invalids > 0 { + return graphql.Null + } + + atomic.AddInt32(&ec.deferred, int32(len(deferred))) + + for label, dfs := range deferred { + ec.processDeferredGroup(graphql.DeferredGroup{ + Label: label, + Path: graphql.GetPath(ctx), + FieldSet: dfs, + Context: ctx, + }) + } + + return out +} + +var __DirectiveImplementors = []string{"__Directive"} + +func (ec *executionContext) ___Directive(ctx context.Context, sel ast.SelectionSet, obj *introspection.Directive) graphql.Marshaler { + fields := graphql.CollectFields(ec.OperationContext, sel, __DirectiveImplementors) + + out := graphql.NewFieldSet(fields) + deferred := make(map[string]*graphql.FieldSet) + for i, field := range fields { + switch field.Name { + case "__typename": + out.Values[i] = graphql.MarshalString("__Directive") + case "name": + out.Values[i] = ec.___Directive_name(ctx, field, obj) + if out.Values[i] == graphql.Null { + out.Invalids++ + } + case "description": + out.Values[i] = ec.___Directive_description(ctx, field, obj) + case "locations": + out.Values[i] = ec.___Directive_locations(ctx, field, obj) + if out.Values[i] == graphql.Null { + out.Invalids++ + } + case "args": + out.Values[i] = ec.___Directive_args(ctx, field, obj) + if out.Values[i] == graphql.Null { + out.Invalids++ + } + case "isRepeatable": + out.Values[i] = ec.___Directive_isRepeatable(ctx, field, obj) + if out.Values[i] == graphql.Null { + out.Invalids++ + } + default: + panic("unknown field " + strconv.Quote(field.Name)) + } + } + out.Dispatch(ctx) + if out.Invalids > 0 { + return graphql.Null + } + + atomic.AddInt32(&ec.deferred, int32(len(deferred))) + + for label, dfs := range deferred { + ec.processDeferredGroup(graphql.DeferredGroup{ + Label: label, + Path: graphql.GetPath(ctx), + FieldSet: dfs, + Context: ctx, + }) + } + + return out +} + +var __EnumValueImplementors = []string{"__EnumValue"} + +func (ec *executionContext) ___EnumValue(ctx context.Context, sel ast.SelectionSet, obj *introspection.EnumValue) graphql.Marshaler { + fields := graphql.CollectFields(ec.OperationContext, sel, __EnumValueImplementors) + + out := graphql.NewFieldSet(fields) + deferred := make(map[string]*graphql.FieldSet) + for i, field := range fields { + switch field.Name { + case "__typename": + out.Values[i] = graphql.MarshalString("__EnumValue") + case "name": + out.Values[i] = ec.___EnumValue_name(ctx, field, obj) + if out.Values[i] == graphql.Null { + out.Invalids++ + } + case "description": + out.Values[i] = ec.___EnumValue_description(ctx, field, obj) + case "isDeprecated": + out.Values[i] = ec.___EnumValue_isDeprecated(ctx, field, obj) + if out.Values[i] == graphql.Null { + out.Invalids++ + } + case "deprecationReason": + out.Values[i] = ec.___EnumValue_deprecationReason(ctx, field, obj) + default: + panic("unknown field " + strconv.Quote(field.Name)) + } + } + out.Dispatch(ctx) + if out.Invalids > 0 { + return graphql.Null + } + + atomic.AddInt32(&ec.deferred, int32(len(deferred))) + + for label, dfs := range deferred { + ec.processDeferredGroup(graphql.DeferredGroup{ + Label: label, + Path: graphql.GetPath(ctx), + FieldSet: dfs, + Context: ctx, + }) + } + + return out +} + +var __FieldImplementors = []string{"__Field"} + +func (ec *executionContext) ___Field(ctx context.Context, sel ast.SelectionSet, obj *introspection.Field) graphql.Marshaler { + fields := graphql.CollectFields(ec.OperationContext, sel, __FieldImplementors) + + out := graphql.NewFieldSet(fields) + deferred := make(map[string]*graphql.FieldSet) + for i, field := range fields { + switch field.Name { + case "__typename": + out.Values[i] = graphql.MarshalString("__Field") + case "name": + out.Values[i] = ec.___Field_name(ctx, field, obj) + if out.Values[i] == graphql.Null { + out.Invalids++ + } + case "description": + out.Values[i] = ec.___Field_description(ctx, field, obj) + case "args": + out.Values[i] = ec.___Field_args(ctx, field, obj) + if out.Values[i] == graphql.Null { + out.Invalids++ + } + case "type": + out.Values[i] = ec.___Field_type(ctx, field, obj) + if out.Values[i] == graphql.Null { + out.Invalids++ + } + case "isDeprecated": + out.Values[i] = ec.___Field_isDeprecated(ctx, field, obj) + if out.Values[i] == graphql.Null { + out.Invalids++ + } + case "deprecationReason": + out.Values[i] = ec.___Field_deprecationReason(ctx, field, obj) + default: + panic("unknown field " + strconv.Quote(field.Name)) + } + } + out.Dispatch(ctx) + if out.Invalids > 0 { + return graphql.Null + } + + atomic.AddInt32(&ec.deferred, int32(len(deferred))) + + for label, dfs := range deferred { + ec.processDeferredGroup(graphql.DeferredGroup{ + Label: label, + Path: graphql.GetPath(ctx), + FieldSet: dfs, + Context: ctx, + }) + } + + return out +} + +var __InputValueImplementors = []string{"__InputValue"} + +func (ec *executionContext) ___InputValue(ctx context.Context, sel ast.SelectionSet, obj *introspection.InputValue) graphql.Marshaler { + fields := graphql.CollectFields(ec.OperationContext, sel, __InputValueImplementors) + + out := graphql.NewFieldSet(fields) + deferred := make(map[string]*graphql.FieldSet) + for i, field := range fields { + switch field.Name { + case "__typename": + out.Values[i] = graphql.MarshalString("__InputValue") + case "name": + out.Values[i] = ec.___InputValue_name(ctx, field, obj) + if out.Values[i] == graphql.Null { + out.Invalids++ + } + case "description": + out.Values[i] = ec.___InputValue_description(ctx, field, obj) + case "type": + out.Values[i] = ec.___InputValue_type(ctx, field, obj) + if out.Values[i] == graphql.Null { + out.Invalids++ + } + case "defaultValue": + out.Values[i] = ec.___InputValue_defaultValue(ctx, field, obj) + default: + panic("unknown field " + strconv.Quote(field.Name)) + } + } + out.Dispatch(ctx) + if out.Invalids > 0 { + return graphql.Null + } + + atomic.AddInt32(&ec.deferred, int32(len(deferred))) + + for label, dfs := range deferred { + ec.processDeferredGroup(graphql.DeferredGroup{ + Label: label, + Path: graphql.GetPath(ctx), + FieldSet: dfs, + Context: ctx, + }) + } + + return out +} + +var __SchemaImplementors = []string{"__Schema"} + +func (ec *executionContext) ___Schema(ctx context.Context, sel ast.SelectionSet, obj *introspection.Schema) graphql.Marshaler { + fields := graphql.CollectFields(ec.OperationContext, sel, __SchemaImplementors) + + out := graphql.NewFieldSet(fields) + deferred := make(map[string]*graphql.FieldSet) + for i, field := range fields { + switch field.Name { + case "__typename": + out.Values[i] = graphql.MarshalString("__Schema") + case "description": + out.Values[i] = ec.___Schema_description(ctx, field, obj) + case "types": + out.Values[i] = ec.___Schema_types(ctx, field, obj) + if out.Values[i] == graphql.Null { + out.Invalids++ + } + case "queryType": + out.Values[i] = ec.___Schema_queryType(ctx, field, obj) + if out.Values[i] == graphql.Null { + out.Invalids++ + } + case "mutationType": + out.Values[i] = ec.___Schema_mutationType(ctx, field, obj) + case "subscriptionType": + out.Values[i] = ec.___Schema_subscriptionType(ctx, field, obj) + case "directives": + out.Values[i] = ec.___Schema_directives(ctx, field, obj) + if out.Values[i] == graphql.Null { + out.Invalids++ + } + default: + panic("unknown field " + strconv.Quote(field.Name)) + } + } + out.Dispatch(ctx) + if out.Invalids > 0 { + return graphql.Null + } + + atomic.AddInt32(&ec.deferred, int32(len(deferred))) + + for label, dfs := range deferred { + ec.processDeferredGroup(graphql.DeferredGroup{ + Label: label, + Path: graphql.GetPath(ctx), + FieldSet: dfs, + Context: ctx, + }) + } + + return out +} + +var __TypeImplementors = []string{"__Type"} + +func (ec *executionContext) ___Type(ctx context.Context, sel ast.SelectionSet, obj *introspection.Type) graphql.Marshaler { + fields := graphql.CollectFields(ec.OperationContext, sel, __TypeImplementors) + + out := graphql.NewFieldSet(fields) + deferred := make(map[string]*graphql.FieldSet) + for i, field := range fields { + switch field.Name { + case "__typename": + out.Values[i] = graphql.MarshalString("__Type") + case "kind": + out.Values[i] = ec.___Type_kind(ctx, field, obj) + if out.Values[i] == graphql.Null { + out.Invalids++ + } + case "name": + out.Values[i] = ec.___Type_name(ctx, field, obj) + case "description": + out.Values[i] = ec.___Type_description(ctx, field, obj) + case "fields": + out.Values[i] = ec.___Type_fields(ctx, field, obj) + case "interfaces": + out.Values[i] = ec.___Type_interfaces(ctx, field, obj) + case "possibleTypes": + out.Values[i] = ec.___Type_possibleTypes(ctx, field, obj) + case "enumValues": + out.Values[i] = ec.___Type_enumValues(ctx, field, obj) + case "inputFields": + out.Values[i] = ec.___Type_inputFields(ctx, field, obj) + case "ofType": + out.Values[i] = ec.___Type_ofType(ctx, field, obj) + case "specifiedByURL": + out.Values[i] = ec.___Type_specifiedByURL(ctx, field, obj) + default: + panic("unknown field " + strconv.Quote(field.Name)) + } + } + out.Dispatch(ctx) + if out.Invalids > 0 { + return graphql.Null + } + + atomic.AddInt32(&ec.deferred, int32(len(deferred))) + + for label, dfs := range deferred { + ec.processDeferredGroup(graphql.DeferredGroup{ + Label: label, + Path: graphql.GetPath(ctx), + FieldSet: dfs, + Context: ctx, + }) + } + + return out +} + +// endregion **************************** object.gotpl **************************** + +// region ***************************** type.gotpl ***************************** + +func (ec *executionContext) unmarshalNBoolean2bool(ctx context.Context, v interface{}) (bool, error) { + res, err := graphql.UnmarshalBoolean(v) + return res, graphql.ErrorOnPath(ctx, err) +} + +func (ec *executionContext) marshalNBoolean2bool(ctx context.Context, sel ast.SelectionSet, v bool) graphql.Marshaler { + res := graphql.MarshalBoolean(v) + if res == graphql.Null { + if !graphql.HasFieldError(ctx, graphql.GetFieldContext(ctx)) { + ec.Errorf(ctx, "the requested element is null which the schema does not allow") + } + } + return res +} + +func (ec *executionContext) unmarshalNComputePlatformType2githubᚗcomᚋodigosᚑioᚋodigosᚋfrontendᚋgraphᚋmodelᚐComputePlatformType(ctx context.Context, v interface{}) (model.ComputePlatformType, error) { + var res model.ComputePlatformType + err := res.UnmarshalGQL(v) + return res, graphql.ErrorOnPath(ctx, err) +} + +func (ec *executionContext) marshalNComputePlatformType2githubᚗcomᚋodigosᚑioᚋodigosᚋfrontendᚋgraphᚋmodelᚐComputePlatformType(ctx context.Context, sel ast.SelectionSet, v model.ComputePlatformType) graphql.Marshaler { + return v +} + +func (ec *executionContext) marshalNCondition2ᚖgithubᚗcomᚋodigosᚑioᚋodigosᚋfrontendᚋgraphᚋmodelᚐCondition(ctx context.Context, sel ast.SelectionSet, v *model.Condition) graphql.Marshaler { + if v == nil { + if !graphql.HasFieldError(ctx, graphql.GetFieldContext(ctx)) { + ec.Errorf(ctx, "the requested element is null which the schema does not allow") + } + return graphql.Null + } + return ec._Condition(ctx, sel, v) +} + +func (ec *executionContext) unmarshalNConditionStatus2githubᚗcomᚋodigosᚑioᚋodigosᚋfrontendᚋgraphᚋmodelᚐConditionStatus(ctx context.Context, v interface{}) (model.ConditionStatus, error) { + var res model.ConditionStatus + err := res.UnmarshalGQL(v) + return res, graphql.ErrorOnPath(ctx, err) +} + +func (ec *executionContext) marshalNConditionStatus2githubᚗcomᚋodigosᚑioᚋodigosᚋfrontendᚋgraphᚋmodelᚐConditionStatus(ctx context.Context, sel ast.SelectionSet, v model.ConditionStatus) graphql.Marshaler { + return v +} + +func (ec *executionContext) marshalNDestination2githubᚗcomᚋodigosᚑioᚋodigosᚋfrontendᚋgraphᚋmodelᚐDestination(ctx context.Context, sel ast.SelectionSet, v model.Destination) graphql.Marshaler { + return ec._Destination(ctx, sel, &v) +} + +func (ec *executionContext) marshalNDestination2ᚕᚖgithubᚗcomᚋodigosᚑioᚋodigosᚋfrontendᚋgraphᚋmodelᚐDestinationᚄ(ctx context.Context, sel ast.SelectionSet, v []*model.Destination) graphql.Marshaler { + ret := make(graphql.Array, len(v)) + var wg sync.WaitGroup + isLen1 := len(v) == 1 + if !isLen1 { + wg.Add(len(v)) + } + for i := range v { + i := i + fc := &graphql.FieldContext{ + Index: &i, + Result: &v[i], + } + ctx := graphql.WithFieldContext(ctx, fc) + f := func(i int) { + defer func() { + if r := recover(); r != nil { + ec.Error(ctx, ec.Recover(ctx, r)) + ret = nil + } + }() + if !isLen1 { + defer wg.Done() + } + ret[i] = ec.marshalNDestination2ᚖgithubᚗcomᚋodigosᚑioᚋodigosᚋfrontendᚋgraphᚋmodelᚐDestination(ctx, sel, v[i]) + } + if isLen1 { + f(i) + } else { + go f(i) + } + + } + wg.Wait() + + for _, e := range ret { + if e == graphql.Null { + return graphql.Null + } + } + + return ret +} + +func (ec *executionContext) marshalNDestination2ᚖgithubᚗcomᚋodigosᚑioᚋodigosᚋfrontendᚋgraphᚋmodelᚐDestination(ctx context.Context, sel ast.SelectionSet, v *model.Destination) graphql.Marshaler { + if v == nil { + if !graphql.HasFieldError(ctx, graphql.GetFieldContext(ctx)) { + ec.Errorf(ctx, "the requested element is null which the schema does not allow") + } + return graphql.Null + } + return ec._Destination(ctx, sel, v) +} + +func (ec *executionContext) marshalNDestinationDetails2ᚕᚖgithubᚗcomᚋodigosᚑioᚋodigosᚋfrontendᚋgraphᚋmodelᚐDestinationDetailsᚄ(ctx context.Context, sel ast.SelectionSet, v []*model.DestinationDetails) graphql.Marshaler { + ret := make(graphql.Array, len(v)) + var wg sync.WaitGroup + isLen1 := len(v) == 1 + if !isLen1 { + wg.Add(len(v)) + } + for i := range v { + i := i + fc := &graphql.FieldContext{ + Index: &i, + Result: &v[i], + } + ctx := graphql.WithFieldContext(ctx, fc) + f := func(i int) { + defer func() { + if r := recover(); r != nil { + ec.Error(ctx, ec.Recover(ctx, r)) + ret = nil + } + }() + if !isLen1 { + defer wg.Done() + } + ret[i] = ec.marshalNDestinationDetails2ᚖgithubᚗcomᚋodigosᚑioᚋodigosᚋfrontendᚋgraphᚋmodelᚐDestinationDetails(ctx, sel, v[i]) + } + if isLen1 { + f(i) + } else { + go f(i) + } + + } + wg.Wait() + + for _, e := range ret { + if e == graphql.Null { + return graphql.Null + } + } + + return ret +} + +func (ec *executionContext) marshalNDestinationDetails2ᚖgithubᚗcomᚋodigosᚑioᚋodigosᚋfrontendᚋgraphᚋmodelᚐDestinationDetails(ctx context.Context, sel ast.SelectionSet, v *model.DestinationDetails) graphql.Marshaler { + if v == nil { + if !graphql.HasFieldError(ctx, graphql.GetFieldContext(ctx)) { + ec.Errorf(ctx, "the requested element is null which the schema does not allow") + } + return graphql.Null + } + return ec._DestinationDetails(ctx, sel, v) +} + +func (ec *executionContext) unmarshalNDestinationInput2githubᚗcomᚋodigosᚑioᚋodigosᚋfrontendᚋgraphᚋmodelᚐDestinationInput(ctx context.Context, v interface{}) (model.DestinationInput, error) { + res, err := ec.unmarshalInputDestinationInput(ctx, v) + return res, graphql.ErrorOnPath(ctx, err) +} + +func (ec *executionContext) marshalNDestinationTypesCategoryItem2githubᚗcomᚋodigosᚑioᚋodigosᚋfrontendᚋgraphᚋmodelᚐDestinationTypesCategoryItem(ctx context.Context, sel ast.SelectionSet, v model.DestinationTypesCategoryItem) graphql.Marshaler { + return ec._DestinationTypesCategoryItem(ctx, sel, &v) +} + +func (ec *executionContext) marshalNDestinationTypesCategoryItem2ᚕgithubᚗcomᚋodigosᚑioᚋodigosᚋfrontendᚋgraphᚋmodelᚐDestinationTypesCategoryItemᚄ(ctx context.Context, sel ast.SelectionSet, v []model.DestinationTypesCategoryItem) graphql.Marshaler { + ret := make(graphql.Array, len(v)) + var wg sync.WaitGroup + isLen1 := len(v) == 1 + if !isLen1 { + wg.Add(len(v)) + } + for i := range v { + i := i + fc := &graphql.FieldContext{ + Index: &i, + Result: &v[i], + } + ctx := graphql.WithFieldContext(ctx, fc) + f := func(i int) { + defer func() { + if r := recover(); r != nil { + ec.Error(ctx, ec.Recover(ctx, r)) + ret = nil + } + }() + if !isLen1 { + defer wg.Done() + } + ret[i] = ec.marshalNDestinationTypesCategoryItem2githubᚗcomᚋodigosᚑioᚋodigosᚋfrontendᚋgraphᚋmodelᚐDestinationTypesCategoryItem(ctx, sel, v[i]) + } + if isLen1 { + f(i) + } else { + go f(i) + } + + } + wg.Wait() + + for _, e := range ret { + if e == graphql.Null { + return graphql.Null + } + } + + return ret +} + +func (ec *executionContext) marshalNDestinationsCategory2githubᚗcomᚋodigosᚑioᚋodigosᚋfrontendᚋgraphᚋmodelᚐDestinationsCategory(ctx context.Context, sel ast.SelectionSet, v model.DestinationsCategory) graphql.Marshaler { + return ec._DestinationsCategory(ctx, sel, &v) +} + +func (ec *executionContext) marshalNDestinationsCategory2ᚕgithubᚗcomᚋodigosᚑioᚋodigosᚋfrontendᚋgraphᚋmodelᚐDestinationsCategoryᚄ(ctx context.Context, sel ast.SelectionSet, v []model.DestinationsCategory) graphql.Marshaler { + ret := make(graphql.Array, len(v)) + var wg sync.WaitGroup + isLen1 := len(v) == 1 + if !isLen1 { + wg.Add(len(v)) + } + for i := range v { + i := i + fc := &graphql.FieldContext{ + Index: &i, + Result: &v[i], + } + ctx := graphql.WithFieldContext(ctx, fc) + f := func(i int) { + defer func() { + if r := recover(); r != nil { + ec.Error(ctx, ec.Recover(ctx, r)) + ret = nil + } + }() + if !isLen1 { + defer wg.Done() + } + ret[i] = ec.marshalNDestinationsCategory2githubᚗcomᚋodigosᚑioᚋodigosᚋfrontendᚋgraphᚋmodelᚐDestinationsCategory(ctx, sel, v[i]) + } + if isLen1 { + f(i) + } else { + go f(i) + } + + } + wg.Wait() + + for _, e := range ret { + if e == graphql.Null { + return graphql.Null + } + } + + return ret +} + +func (ec *executionContext) marshalNExportedSignals2githubᚗcomᚋodigosᚑioᚋodigosᚋfrontendᚋgraphᚋmodelᚐExportedSignals(ctx context.Context, sel ast.SelectionSet, v model.ExportedSignals) graphql.Marshaler { + return ec._ExportedSignals(ctx, sel, &v) +} + +func (ec *executionContext) unmarshalNExportedSignalsInput2ᚖgithubᚗcomᚋodigosᚑioᚋodigosᚋfrontendᚋgraphᚋmodelᚐExportedSignalsInput(ctx context.Context, v interface{}) (*model.ExportedSignalsInput, error) { + res, err := ec.unmarshalInputExportedSignalsInput(ctx, v) + return &res, graphql.ErrorOnPath(ctx, err) +} + +func (ec *executionContext) marshalNField2ᚕᚖgithubᚗcomᚋodigosᚑioᚋodigosᚋfrontendᚋgraphᚋmodelᚐFieldᚄ(ctx context.Context, sel ast.SelectionSet, v []*model.Field) graphql.Marshaler { + ret := make(graphql.Array, len(v)) + var wg sync.WaitGroup + isLen1 := len(v) == 1 + if !isLen1 { + wg.Add(len(v)) + } + for i := range v { + i := i + fc := &graphql.FieldContext{ + Index: &i, + Result: &v[i], + } + ctx := graphql.WithFieldContext(ctx, fc) + f := func(i int) { + defer func() { + if r := recover(); r != nil { + ec.Error(ctx, ec.Recover(ctx, r)) + ret = nil + } + }() + if !isLen1 { + defer wg.Done() + } + ret[i] = ec.marshalNField2ᚖgithubᚗcomᚋodigosᚑioᚋodigosᚋfrontendᚋgraphᚋmodelᚐField(ctx, sel, v[i]) + } + if isLen1 { + f(i) + } else { + go f(i) + } + + } + wg.Wait() + + for _, e := range ret { + if e == graphql.Null { + return graphql.Null + } + } + + return ret +} + +func (ec *executionContext) marshalNField2ᚖgithubᚗcomᚋodigosᚑioᚋodigosᚋfrontendᚋgraphᚋmodelᚐField(ctx context.Context, sel ast.SelectionSet, v *model.Field) graphql.Marshaler { + if v == nil { + if !graphql.HasFieldError(ctx, graphql.GetFieldContext(ctx)) { + ec.Errorf(ctx, "the requested element is null which the schema does not allow") + } + return graphql.Null + } + return ec._Field(ctx, sel, v) +} + +func (ec *executionContext) unmarshalNFieldInput2ᚕᚖgithubᚗcomᚋodigosᚑioᚋodigosᚋfrontendᚋgraphᚋmodelᚐFieldInputᚄ(ctx context.Context, v interface{}) ([]*model.FieldInput, error) { + var vSlice []interface{} + if v != nil { + vSlice = graphql.CoerceList(v) + } + var err error + res := make([]*model.FieldInput, len(vSlice)) + for i := range vSlice { + ctx := graphql.WithPathContext(ctx, graphql.NewPathWithIndex(i)) + res[i], err = ec.unmarshalNFieldInput2ᚖgithubᚗcomᚋodigosᚑioᚋodigosᚋfrontendᚋgraphᚋmodelᚐFieldInput(ctx, vSlice[i]) + if err != nil { + return nil, err + } + } + return res, nil +} + +func (ec *executionContext) unmarshalNFieldInput2ᚖgithubᚗcomᚋodigosᚑioᚋodigosᚋfrontendᚋgraphᚋmodelᚐFieldInput(ctx context.Context, v interface{}) (*model.FieldInput, error) { + res, err := ec.unmarshalInputFieldInput(ctx, v) + return &res, graphql.ErrorOnPath(ctx, err) +} + +func (ec *executionContext) unmarshalNID2string(ctx context.Context, v interface{}) (string, error) { + res, err := graphql.UnmarshalID(v) + return res, graphql.ErrorOnPath(ctx, err) +} + +func (ec *executionContext) marshalNID2string(ctx context.Context, sel ast.SelectionSet, v string) graphql.Marshaler { + res := graphql.MarshalID(v) + if res == graphql.Null { + if !graphql.HasFieldError(ctx, graphql.GetFieldContext(ctx)) { + ec.Errorf(ctx, "the requested element is null which the schema does not allow") + } + } + return res +} + +func (ec *executionContext) marshalNIcaInstanceResponse2ᚕᚖgithubᚗcomᚋodigosᚑioᚋodigosᚋfrontendᚋgraphᚋmodelᚐIcaInstanceResponseᚄ(ctx context.Context, sel ast.SelectionSet, v []*model.IcaInstanceResponse) graphql.Marshaler { + ret := make(graphql.Array, len(v)) + var wg sync.WaitGroup + isLen1 := len(v) == 1 + if !isLen1 { + wg.Add(len(v)) + } + for i := range v { + i := i + fc := &graphql.FieldContext{ + Index: &i, + Result: &v[i], + } + ctx := graphql.WithFieldContext(ctx, fc) + f := func(i int) { + defer func() { + if r := recover(); r != nil { + ec.Error(ctx, ec.Recover(ctx, r)) + ret = nil + } + }() + if !isLen1 { + defer wg.Done() + } + ret[i] = ec.marshalNIcaInstanceResponse2ᚖgithubᚗcomᚋodigosᚑioᚋodigosᚋfrontendᚋgraphᚋmodelᚐIcaInstanceResponse(ctx, sel, v[i]) + } + if isLen1 { + f(i) + } else { + go f(i) + } + + } + wg.Wait() + + for _, e := range ret { + if e == graphql.Null { + return graphql.Null + } + } + + return ret +} + +func (ec *executionContext) marshalNIcaInstanceResponse2ᚖgithubᚗcomᚋodigosᚑioᚋodigosᚋfrontendᚋgraphᚋmodelᚐIcaInstanceResponse(ctx context.Context, sel ast.SelectionSet, v *model.IcaInstanceResponse) graphql.Marshaler { + if v == nil { + if !graphql.HasFieldError(ctx, graphql.GetFieldContext(ctx)) { + ec.Errorf(ctx, "the requested element is null which the schema does not allow") + } + return graphql.Null + } + return ec._IcaInstanceResponse(ctx, sel, v) +} + +func (ec *executionContext) unmarshalNInstallationStatus2githubᚗcomᚋodigosᚑioᚋodigosᚋfrontendᚋgraphᚋmodelᚐInstallationStatus(ctx context.Context, v interface{}) (model.InstallationStatus, error) { + var res model.InstallationStatus + err := res.UnmarshalGQL(v) + return res, graphql.ErrorOnPath(ctx, err) +} + +func (ec *executionContext) marshalNInstallationStatus2githubᚗcomᚋodigosᚑioᚋodigosᚋfrontendᚋgraphᚋmodelᚐInstallationStatus(ctx context.Context, sel ast.SelectionSet, v model.InstallationStatus) graphql.Marshaler { + return v +} + +func (ec *executionContext) marshalNInstrumentationLibrary2ᚕᚖgithubᚗcomᚋodigosᚑioᚋodigosᚋfrontendᚋgraphᚋmodelᚐInstrumentationLibraryᚄ(ctx context.Context, sel ast.SelectionSet, v []*model.InstrumentationLibrary) graphql.Marshaler { + ret := make(graphql.Array, len(v)) + var wg sync.WaitGroup + isLen1 := len(v) == 1 + if !isLen1 { + wg.Add(len(v)) + } + for i := range v { + i := i + fc := &graphql.FieldContext{ + Index: &i, + Result: &v[i], + } + ctx := graphql.WithFieldContext(ctx, fc) + f := func(i int) { + defer func() { + if r := recover(); r != nil { + ec.Error(ctx, ec.Recover(ctx, r)) + ret = nil + } + }() + if !isLen1 { + defer wg.Done() + } + ret[i] = ec.marshalNInstrumentationLibrary2ᚖgithubᚗcomᚋodigosᚑioᚋodigosᚋfrontendᚋgraphᚋmodelᚐInstrumentationLibrary(ctx, sel, v[i]) + } + if isLen1 { + f(i) + } else { + go f(i) + } + + } + wg.Wait() + + for _, e := range ret { + if e == graphql.Null { + return graphql.Null + } + } + + return ret +} + +func (ec *executionContext) marshalNInstrumentationLibrary2ᚖgithubᚗcomᚋodigosᚑioᚋodigosᚋfrontendᚋgraphᚋmodelᚐInstrumentationLibrary(ctx context.Context, sel ast.SelectionSet, v *model.InstrumentationLibrary) graphql.Marshaler { + if v == nil { + if !graphql.HasFieldError(ctx, graphql.GetFieldContext(ctx)) { + ec.Errorf(ctx, "the requested element is null which the schema does not allow") + } + return graphql.Null + } + return ec._InstrumentationLibrary(ctx, sel, v) +} + +func (ec *executionContext) marshalNInstrumentationOption2ᚕᚖgithubᚗcomᚋodigosᚑioᚋodigosᚋfrontendᚋgraphᚋmodelᚐInstrumentationOptionᚄ(ctx context.Context, sel ast.SelectionSet, v []*model.InstrumentationOption) graphql.Marshaler { + ret := make(graphql.Array, len(v)) + var wg sync.WaitGroup + isLen1 := len(v) == 1 + if !isLen1 { + wg.Add(len(v)) + } + for i := range v { + i := i + fc := &graphql.FieldContext{ + Index: &i, + Result: &v[i], + } + ctx := graphql.WithFieldContext(ctx, fc) + f := func(i int) { + defer func() { + if r := recover(); r != nil { + ec.Error(ctx, ec.Recover(ctx, r)) + ret = nil + } + }() + if !isLen1 { + defer wg.Done() + } + ret[i] = ec.marshalNInstrumentationOption2ᚖgithubᚗcomᚋodigosᚑioᚋodigosᚋfrontendᚋgraphᚋmodelᚐInstrumentationOption(ctx, sel, v[i]) + } + if isLen1 { + f(i) + } else { + go f(i) + } + + } + wg.Wait() + + for _, e := range ret { + if e == graphql.Null { + return graphql.Null + } + } + + return ret +} + +func (ec *executionContext) marshalNInstrumentationOption2ᚖgithubᚗcomᚋodigosᚑioᚋodigosᚋfrontendᚋgraphᚋmodelᚐInstrumentationOption(ctx context.Context, sel ast.SelectionSet, v *model.InstrumentationOption) graphql.Marshaler { + if v == nil { + if !graphql.HasFieldError(ctx, graphql.GetFieldContext(ctx)) { + ec.Errorf(ctx, "the requested element is null which the schema does not allow") + } + return graphql.Null + } + return ec._InstrumentationOption(ctx, sel, v) +} + +func (ec *executionContext) unmarshalNInt2int(ctx context.Context, v interface{}) (int, error) { + res, err := graphql.UnmarshalInt(v) + return res, graphql.ErrorOnPath(ctx, err) +} + +func (ec *executionContext) marshalNInt2int(ctx context.Context, sel ast.SelectionSet, v int) graphql.Marshaler { + res := graphql.MarshalInt(v) + if res == graphql.Null { + if !graphql.HasFieldError(ctx, graphql.GetFieldContext(ctx)) { + ec.Errorf(ctx, "the requested element is null which the schema does not allow") + } + } + return res +} + +func (ec *executionContext) marshalNK8sActualNamespace2ᚕᚖgithubᚗcomᚋodigosᚑioᚋodigosᚋfrontendᚋgraphᚋmodelᚐK8sActualNamespace(ctx context.Context, sel ast.SelectionSet, v []*model.K8sActualNamespace) graphql.Marshaler { + ret := make(graphql.Array, len(v)) + var wg sync.WaitGroup + isLen1 := len(v) == 1 + if !isLen1 { + wg.Add(len(v)) + } + for i := range v { + i := i + fc := &graphql.FieldContext{ + Index: &i, + Result: &v[i], + } + ctx := graphql.WithFieldContext(ctx, fc) + f := func(i int) { + defer func() { + if r := recover(); r != nil { + ec.Error(ctx, ec.Recover(ctx, r)) + ret = nil + } + }() + if !isLen1 { + defer wg.Done() + } + ret[i] = ec.marshalOK8sActualNamespace2ᚖgithubᚗcomᚋodigosᚑioᚋodigosᚋfrontendᚋgraphᚋmodelᚐK8sActualNamespace(ctx, sel, v[i]) + } + if isLen1 { + f(i) + } else { + go f(i) + } + + } + wg.Wait() + + return ret +} + +func (ec *executionContext) marshalNK8sActualSource2ᚕᚖgithubᚗcomᚋodigosᚑioᚋodigosᚋfrontendᚋgraphᚋmodelᚐK8sActualSource(ctx context.Context, sel ast.SelectionSet, v []*model.K8sActualSource) graphql.Marshaler { + ret := make(graphql.Array, len(v)) + var wg sync.WaitGroup + isLen1 := len(v) == 1 + if !isLen1 { + wg.Add(len(v)) + } + for i := range v { + i := i + fc := &graphql.FieldContext{ + Index: &i, + Result: &v[i], + } + ctx := graphql.WithFieldContext(ctx, fc) + f := func(i int) { + defer func() { + if r := recover(); r != nil { + ec.Error(ctx, ec.Recover(ctx, r)) + ret = nil + } + }() + if !isLen1 { + defer wg.Done() + } + ret[i] = ec.marshalOK8sActualSource2ᚖgithubᚗcomᚋodigosᚑioᚋodigosᚋfrontendᚋgraphᚋmodelᚐK8sActualSource(ctx, sel, v[i]) + } + if isLen1 { + f(i) + } else { + go f(i) + } + + } + wg.Wait() + + return ret +} + +func (ec *executionContext) unmarshalNK8sResourceKind2githubᚗcomᚋodigosᚑioᚋodigosᚋfrontendᚋgraphᚋmodelᚐK8sResourceKind(ctx context.Context, v interface{}) (model.K8sResourceKind, error) { + var res model.K8sResourceKind + err := res.UnmarshalGQL(v) + return res, graphql.ErrorOnPath(ctx, err) +} + +func (ec *executionContext) marshalNK8sResourceKind2githubᚗcomᚋodigosᚑioᚋodigosᚋfrontendᚋgraphᚋmodelᚐK8sResourceKind(ctx context.Context, sel ast.SelectionSet, v model.K8sResourceKind) graphql.Marshaler { + return v +} + +func (ec *executionContext) unmarshalNK8sSourceId2githubᚗcomᚋodigosᚑioᚋodigosᚋfrontendᚋgraphᚋmodelᚐK8sSourceID(ctx context.Context, v interface{}) (model.K8sSourceID, error) { + res, err := ec.unmarshalInputK8sSourceId(ctx, v) + return res, graphql.ErrorOnPath(ctx, err) +} + +func (ec *executionContext) marshalNObservabilitySignalSupport2githubᚗcomᚋodigosᚑioᚋodigosᚋfrontendᚋgraphᚋmodelᚐObservabilitySignalSupport(ctx context.Context, sel ast.SelectionSet, v model.ObservabilitySignalSupport) graphql.Marshaler { + return ec._ObservabilitySignalSupport(ctx, sel, &v) +} + +func (ec *executionContext) unmarshalNPatchSourceRequestInput2githubᚗcomᚋodigosᚑioᚋodigosᚋfrontendᚋgraphᚋmodelᚐPatchSourceRequestInput(ctx context.Context, v interface{}) (model.PatchSourceRequestInput, error) { + res, err := ec.unmarshalInputPatchSourceRequestInput(ctx, v) + return res, graphql.ErrorOnPath(ctx, err) +} + +func (ec *executionContext) unmarshalNPersistNamespaceItemInput2githubᚗcomᚋodigosᚑioᚋodigosᚋfrontendᚋgraphᚋmodelᚐPersistNamespaceItemInput(ctx context.Context, v interface{}) (model.PersistNamespaceItemInput, error) { + res, err := ec.unmarshalInputPersistNamespaceItemInput(ctx, v) + return res, graphql.ErrorOnPath(ctx, err) +} + +func (ec *executionContext) unmarshalNPersistNamespaceSourceInput2ᚕᚖgithubᚗcomᚋodigosᚑioᚋodigosᚋfrontendᚋgraphᚋmodelᚐPersistNamespaceSourceInputᚄ(ctx context.Context, v interface{}) ([]*model.PersistNamespaceSourceInput, error) { + var vSlice []interface{} + if v != nil { + vSlice = graphql.CoerceList(v) + } + var err error + res := make([]*model.PersistNamespaceSourceInput, len(vSlice)) + for i := range vSlice { + ctx := graphql.WithPathContext(ctx, graphql.NewPathWithIndex(i)) + res[i], err = ec.unmarshalNPersistNamespaceSourceInput2ᚖgithubᚗcomᚋodigosᚑioᚋodigosᚋfrontendᚋgraphᚋmodelᚐPersistNamespaceSourceInput(ctx, vSlice[i]) + if err != nil { + return nil, err + } + } + return res, nil +} + +func (ec *executionContext) unmarshalNPersistNamespaceSourceInput2ᚖgithubᚗcomᚋodigosᚑioᚋodigosᚋfrontendᚋgraphᚋmodelᚐPersistNamespaceSourceInput(ctx context.Context, v interface{}) (*model.PersistNamespaceSourceInput, error) { + res, err := ec.unmarshalInputPersistNamespaceSourceInput(ctx, v) + return &res, graphql.ErrorOnPath(ctx, err) +} + +func (ec *executionContext) marshalNSourceContainerRuntimeDetails2ᚖgithubᚗcomᚋodigosᚑioᚋodigosᚋfrontendᚋgraphᚋmodelᚐSourceContainerRuntimeDetails(ctx context.Context, sel ast.SelectionSet, v *model.SourceContainerRuntimeDetails) graphql.Marshaler { + if v == nil { + if !graphql.HasFieldError(ctx, graphql.GetFieldContext(ctx)) { + ec.Errorf(ctx, "the requested element is null which the schema does not allow") + } + return graphql.Null + } + return ec._SourceContainerRuntimeDetails(ctx, sel, v) +} + +func (ec *executionContext) unmarshalNSpanKind2githubᚗcomᚋodigosᚑioᚋodigosᚋfrontendᚋgraphᚋmodelᚐSpanKind(ctx context.Context, v interface{}) (model.SpanKind, error) { + var res model.SpanKind + err := res.UnmarshalGQL(v) + return res, graphql.ErrorOnPath(ctx, err) +} + +func (ec *executionContext) marshalNSpanKind2githubᚗcomᚋodigosᚑioᚋodigosᚋfrontendᚋgraphᚋmodelᚐSpanKind(ctx context.Context, sel ast.SelectionSet, v model.SpanKind) graphql.Marshaler { + return v +} + +func (ec *executionContext) unmarshalNString2string(ctx context.Context, v interface{}) (string, error) { + res, err := graphql.UnmarshalString(v) + return res, graphql.ErrorOnPath(ctx, err) +} + +func (ec *executionContext) marshalNString2string(ctx context.Context, sel ast.SelectionSet, v string) graphql.Marshaler { + res := graphql.MarshalString(v) + if res == graphql.Null { + if !graphql.HasFieldError(ctx, graphql.GetFieldContext(ctx)) { + ec.Errorf(ctx, "the requested element is null which the schema does not allow") + } + } + return res +} + +func (ec *executionContext) marshalNSupportedSignals2githubᚗcomᚋodigosᚑioᚋodigosᚋfrontendᚋgraphᚋmodelᚐSupportedSignals(ctx context.Context, sel ast.SelectionSet, v model.SupportedSignals) graphql.Marshaler { + return ec._SupportedSignals(ctx, sel, &v) +} + +func (ec *executionContext) marshalNTestConnectionResponse2githubᚗcomᚋodigosᚑioᚋodigosᚋfrontendᚋgraphᚋmodelᚐTestConnectionResponse(ctx context.Context, sel ast.SelectionSet, v model.TestConnectionResponse) graphql.Marshaler { + return ec._TestConnectionResponse(ctx, sel, &v) +} + +func (ec *executionContext) marshalNTestConnectionResponse2ᚖgithubᚗcomᚋodigosᚑioᚋodigosᚋfrontendᚋgraphᚋmodelᚐTestConnectionResponse(ctx context.Context, sel ast.SelectionSet, v *model.TestConnectionResponse) graphql.Marshaler { + if v == nil { + if !graphql.HasFieldError(ctx, graphql.GetFieldContext(ctx)) { + ec.Errorf(ctx, "the requested element is null which the schema does not allow") + } + return graphql.Null + } + return ec._TestConnectionResponse(ctx, sel, v) +} + +func (ec *executionContext) marshalN__Directive2githubᚗcomᚋ99designsᚋgqlgenᚋgraphqlᚋintrospectionᚐDirective(ctx context.Context, sel ast.SelectionSet, v introspection.Directive) graphql.Marshaler { + return ec.___Directive(ctx, sel, &v) +} + +func (ec *executionContext) marshalN__Directive2ᚕgithubᚗcomᚋ99designsᚋgqlgenᚋgraphqlᚋintrospectionᚐDirectiveᚄ(ctx context.Context, sel ast.SelectionSet, v []introspection.Directive) graphql.Marshaler { + ret := make(graphql.Array, len(v)) + var wg sync.WaitGroup + isLen1 := len(v) == 1 + if !isLen1 { + wg.Add(len(v)) + } + for i := range v { + i := i + fc := &graphql.FieldContext{ + Index: &i, + Result: &v[i], + } + ctx := graphql.WithFieldContext(ctx, fc) + f := func(i int) { + defer func() { + if r := recover(); r != nil { + ec.Error(ctx, ec.Recover(ctx, r)) + ret = nil + } + }() + if !isLen1 { + defer wg.Done() + } + ret[i] = ec.marshalN__Directive2githubᚗcomᚋ99designsᚋgqlgenᚋgraphqlᚋintrospectionᚐDirective(ctx, sel, v[i]) + } + if isLen1 { + f(i) + } else { + go f(i) + } + + } + wg.Wait() + + for _, e := range ret { + if e == graphql.Null { + return graphql.Null + } + } + + return ret +} + +func (ec *executionContext) unmarshalN__DirectiveLocation2string(ctx context.Context, v interface{}) (string, error) { + res, err := graphql.UnmarshalString(v) + return res, graphql.ErrorOnPath(ctx, err) +} + +func (ec *executionContext) marshalN__DirectiveLocation2string(ctx context.Context, sel ast.SelectionSet, v string) graphql.Marshaler { + res := graphql.MarshalString(v) + if res == graphql.Null { + if !graphql.HasFieldError(ctx, graphql.GetFieldContext(ctx)) { + ec.Errorf(ctx, "the requested element is null which the schema does not allow") + } + } + return res +} + +func (ec *executionContext) unmarshalN__DirectiveLocation2ᚕstringᚄ(ctx context.Context, v interface{}) ([]string, error) { + var vSlice []interface{} + if v != nil { + vSlice = graphql.CoerceList(v) + } + var err error + res := make([]string, len(vSlice)) + for i := range vSlice { + ctx := graphql.WithPathContext(ctx, graphql.NewPathWithIndex(i)) + res[i], err = ec.unmarshalN__DirectiveLocation2string(ctx, vSlice[i]) + if err != nil { + return nil, err + } + } + return res, nil +} + +func (ec *executionContext) marshalN__DirectiveLocation2ᚕstringᚄ(ctx context.Context, sel ast.SelectionSet, v []string) graphql.Marshaler { + ret := make(graphql.Array, len(v)) + var wg sync.WaitGroup + isLen1 := len(v) == 1 + if !isLen1 { + wg.Add(len(v)) + } + for i := range v { + i := i + fc := &graphql.FieldContext{ + Index: &i, + Result: &v[i], + } + ctx := graphql.WithFieldContext(ctx, fc) + f := func(i int) { + defer func() { + if r := recover(); r != nil { + ec.Error(ctx, ec.Recover(ctx, r)) + ret = nil + } + }() + if !isLen1 { + defer wg.Done() + } + ret[i] = ec.marshalN__DirectiveLocation2string(ctx, sel, v[i]) + } + if isLen1 { + f(i) + } else { + go f(i) + } + + } + wg.Wait() + + for _, e := range ret { + if e == graphql.Null { + return graphql.Null + } + } + + return ret +} + +func (ec *executionContext) marshalN__EnumValue2githubᚗcomᚋ99designsᚋgqlgenᚋgraphqlᚋintrospectionᚐEnumValue(ctx context.Context, sel ast.SelectionSet, v introspection.EnumValue) graphql.Marshaler { + return ec.___EnumValue(ctx, sel, &v) +} + +func (ec *executionContext) marshalN__Field2githubᚗcomᚋ99designsᚋgqlgenᚋgraphqlᚋintrospectionᚐField(ctx context.Context, sel ast.SelectionSet, v introspection.Field) graphql.Marshaler { + return ec.___Field(ctx, sel, &v) +} + +func (ec *executionContext) marshalN__InputValue2githubᚗcomᚋ99designsᚋgqlgenᚋgraphqlᚋintrospectionᚐInputValue(ctx context.Context, sel ast.SelectionSet, v introspection.InputValue) graphql.Marshaler { + return ec.___InputValue(ctx, sel, &v) +} + +func (ec *executionContext) marshalN__InputValue2ᚕgithubᚗcomᚋ99designsᚋgqlgenᚋgraphqlᚋintrospectionᚐInputValueᚄ(ctx context.Context, sel ast.SelectionSet, v []introspection.InputValue) graphql.Marshaler { + ret := make(graphql.Array, len(v)) + var wg sync.WaitGroup + isLen1 := len(v) == 1 + if !isLen1 { + wg.Add(len(v)) + } + for i := range v { + i := i + fc := &graphql.FieldContext{ + Index: &i, + Result: &v[i], + } + ctx := graphql.WithFieldContext(ctx, fc) + f := func(i int) { + defer func() { + if r := recover(); r != nil { + ec.Error(ctx, ec.Recover(ctx, r)) + ret = nil + } + }() + if !isLen1 { + defer wg.Done() + } + ret[i] = ec.marshalN__InputValue2githubᚗcomᚋ99designsᚋgqlgenᚋgraphqlᚋintrospectionᚐInputValue(ctx, sel, v[i]) + } + if isLen1 { + f(i) + } else { + go f(i) + } + + } + wg.Wait() + + for _, e := range ret { + if e == graphql.Null { + return graphql.Null + } + } + + return ret +} + +func (ec *executionContext) marshalN__Type2githubᚗcomᚋ99designsᚋgqlgenᚋgraphqlᚋintrospectionᚐType(ctx context.Context, sel ast.SelectionSet, v introspection.Type) graphql.Marshaler { + return ec.___Type(ctx, sel, &v) +} + +func (ec *executionContext) marshalN__Type2ᚕgithubᚗcomᚋ99designsᚋgqlgenᚋgraphqlᚋintrospectionᚐTypeᚄ(ctx context.Context, sel ast.SelectionSet, v []introspection.Type) graphql.Marshaler { + ret := make(graphql.Array, len(v)) + var wg sync.WaitGroup + isLen1 := len(v) == 1 + if !isLen1 { + wg.Add(len(v)) + } + for i := range v { + i := i + fc := &graphql.FieldContext{ + Index: &i, + Result: &v[i], + } + ctx := graphql.WithFieldContext(ctx, fc) + f := func(i int) { + defer func() { + if r := recover(); r != nil { + ec.Error(ctx, ec.Recover(ctx, r)) + ret = nil + } + }() + if !isLen1 { + defer wg.Done() + } + ret[i] = ec.marshalN__Type2githubᚗcomᚋ99designsᚋgqlgenᚋgraphqlᚋintrospectionᚐType(ctx, sel, v[i]) + } + if isLen1 { + f(i) + } else { + go f(i) + } + + } + wg.Wait() + + for _, e := range ret { + if e == graphql.Null { + return graphql.Null + } + } + + return ret +} + +func (ec *executionContext) marshalN__Type2ᚖgithubᚗcomᚋ99designsᚋgqlgenᚋgraphqlᚋintrospectionᚐType(ctx context.Context, sel ast.SelectionSet, v *introspection.Type) graphql.Marshaler { + if v == nil { + if !graphql.HasFieldError(ctx, graphql.GetFieldContext(ctx)) { + ec.Errorf(ctx, "the requested element is null which the schema does not allow") + } + return graphql.Null + } + return ec.___Type(ctx, sel, v) +} + +func (ec *executionContext) unmarshalN__TypeKind2string(ctx context.Context, v interface{}) (string, error) { + res, err := graphql.UnmarshalString(v) + return res, graphql.ErrorOnPath(ctx, err) +} + +func (ec *executionContext) marshalN__TypeKind2string(ctx context.Context, sel ast.SelectionSet, v string) graphql.Marshaler { + res := graphql.MarshalString(v) + if res == graphql.Null { + if !graphql.HasFieldError(ctx, graphql.GetFieldContext(ctx)) { + ec.Errorf(ctx, "the requested element is null which the schema does not allow") + } + } + return res +} + +func (ec *executionContext) unmarshalOBoolean2bool(ctx context.Context, v interface{}) (bool, error) { + res, err := graphql.UnmarshalBoolean(v) + return res, graphql.ErrorOnPath(ctx, err) +} + +func (ec *executionContext) marshalOBoolean2bool(ctx context.Context, sel ast.SelectionSet, v bool) graphql.Marshaler { + res := graphql.MarshalBoolean(v) + return res +} + +func (ec *executionContext) unmarshalOBoolean2ᚖbool(ctx context.Context, v interface{}) (*bool, error) { + if v == nil { + return nil, nil + } + res, err := graphql.UnmarshalBoolean(v) + return &res, graphql.ErrorOnPath(ctx, err) +} + +func (ec *executionContext) marshalOBoolean2ᚖbool(ctx context.Context, sel ast.SelectionSet, v *bool) graphql.Marshaler { + if v == nil { + return graphql.Null + } + res := graphql.MarshalBoolean(*v) + return res +} + +func (ec *executionContext) marshalOComputePlatform2ᚖgithubᚗcomᚋodigosᚑioᚋodigosᚋfrontendᚋgraphᚋmodelᚐComputePlatform(ctx context.Context, sel ast.SelectionSet, v *model.ComputePlatform) graphql.Marshaler { + if v == nil { + return graphql.Null + } + return ec._ComputePlatform(ctx, sel, v) +} + +func (ec *executionContext) marshalOCondition2ᚕᚖgithubᚗcomᚋodigosᚑioᚋodigosᚋfrontendᚋgraphᚋmodelᚐConditionᚄ(ctx context.Context, sel ast.SelectionSet, v []*model.Condition) graphql.Marshaler { + if v == nil { + return graphql.Null + } + ret := make(graphql.Array, len(v)) + var wg sync.WaitGroup + isLen1 := len(v) == 1 + if !isLen1 { + wg.Add(len(v)) + } + for i := range v { + i := i + fc := &graphql.FieldContext{ + Index: &i, + Result: &v[i], + } + ctx := graphql.WithFieldContext(ctx, fc) + f := func(i int) { + defer func() { + if r := recover(); r != nil { + ec.Error(ctx, ec.Recover(ctx, r)) + ret = nil + } + }() + if !isLen1 { + defer wg.Done() + } + ret[i] = ec.marshalNCondition2ᚖgithubᚗcomᚋodigosᚑioᚋodigosᚋfrontendᚋgraphᚋmodelᚐCondition(ctx, sel, v[i]) + } + if isLen1 { + f(i) + } else { + go f(i) + } + + } + wg.Wait() + + for _, e := range ret { + if e == graphql.Null { + return graphql.Null + } + } + + return ret +} + +func (ec *executionContext) marshalOGetConfigResponse2ᚖgithubᚗcomᚋodigosᚑioᚋodigosᚋfrontendᚋgraphᚋmodelᚐGetConfigResponse(ctx context.Context, sel ast.SelectionSet, v *model.GetConfigResponse) graphql.Marshaler { + if v == nil { + return graphql.Null + } + return ec._GetConfigResponse(ctx, sel, v) +} + +func (ec *executionContext) marshalOGetDestinationDetailsResponse2ᚖgithubᚗcomᚋodigosᚑioᚋodigosᚋfrontendᚋgraphᚋmodelᚐGetDestinationDetailsResponse(ctx context.Context, sel ast.SelectionSet, v *model.GetDestinationDetailsResponse) graphql.Marshaler { + if v == nil { + return graphql.Null + } + return ec._GetDestinationDetailsResponse(ctx, sel, v) +} + +func (ec *executionContext) marshalOGetDestinationTypesResponse2ᚖgithubᚗcomᚋodigosᚑioᚋodigosᚋfrontendᚋgraphᚋmodelᚐGetDestinationTypesResponse(ctx context.Context, sel ast.SelectionSet, v *model.GetDestinationTypesResponse) graphql.Marshaler { + if v == nil { + return graphql.Null + } + return ec._GetDestinationTypesResponse(ctx, sel, v) +} + +func (ec *executionContext) marshalOInstrumentedApplicationDetails2ᚖgithubᚗcomᚋodigosᚑioᚋodigosᚋfrontendᚋgraphᚋmodelᚐInstrumentedApplicationDetails(ctx context.Context, sel ast.SelectionSet, v *model.InstrumentedApplicationDetails) graphql.Marshaler { + if v == nil { + return graphql.Null + } + return ec._InstrumentedApplicationDetails(ctx, sel, v) +} + +func (ec *executionContext) unmarshalOInt2ᚖint(ctx context.Context, v interface{}) (*int, error) { + if v == nil { + return nil, nil + } + res, err := graphql.UnmarshalInt(v) + return &res, graphql.ErrorOnPath(ctx, err) +} + +func (ec *executionContext) marshalOInt2ᚖint(ctx context.Context, sel ast.SelectionSet, v *int) graphql.Marshaler { + if v == nil { + return graphql.Null + } + res := graphql.MarshalInt(*v) + return res +} + +func (ec *executionContext) marshalOK8sActualNamespace2ᚖgithubᚗcomᚋodigosᚑioᚋodigosᚋfrontendᚋgraphᚋmodelᚐK8sActualNamespace(ctx context.Context, sel ast.SelectionSet, v *model.K8sActualNamespace) graphql.Marshaler { + if v == nil { + return graphql.Null + } + return ec._K8sActualNamespace(ctx, sel, v) +} + +func (ec *executionContext) marshalOK8sActualSource2ᚖgithubᚗcomᚋodigosᚑioᚋodigosᚋfrontendᚋgraphᚋmodelᚐK8sActualSource(ctx context.Context, sel ast.SelectionSet, v *model.K8sActualSource) graphql.Marshaler { + if v == nil { + return graphql.Null + } + return ec._K8sActualSource(ctx, sel, v) +} + +func (ec *executionContext) marshalOSourceContainerRuntimeDetails2ᚕᚖgithubᚗcomᚋodigosᚑioᚋodigosᚋfrontendᚋgraphᚋmodelᚐSourceContainerRuntimeDetailsᚄ(ctx context.Context, sel ast.SelectionSet, v []*model.SourceContainerRuntimeDetails) graphql.Marshaler { + if v == nil { + return graphql.Null + } + ret := make(graphql.Array, len(v)) + var wg sync.WaitGroup + isLen1 := len(v) == 1 + if !isLen1 { + wg.Add(len(v)) + } + for i := range v { + i := i + fc := &graphql.FieldContext{ + Index: &i, + Result: &v[i], + } + ctx := graphql.WithFieldContext(ctx, fc) + f := func(i int) { + defer func() { + if r := recover(); r != nil { + ec.Error(ctx, ec.Recover(ctx, r)) + ret = nil + } + }() + if !isLen1 { + defer wg.Done() + } + ret[i] = ec.marshalNSourceContainerRuntimeDetails2ᚖgithubᚗcomᚋodigosᚑioᚋodigosᚋfrontendᚋgraphᚋmodelᚐSourceContainerRuntimeDetails(ctx, sel, v[i]) + } + if isLen1 { + f(i) + } else { + go f(i) + } + + } + wg.Wait() + + for _, e := range ret { + if e == graphql.Null { + return graphql.Null + } + } + + return ret +} + +func (ec *executionContext) unmarshalOString2ᚖstring(ctx context.Context, v interface{}) (*string, error) { + if v == nil { + return nil, nil + } + res, err := graphql.UnmarshalString(v) + return &res, graphql.ErrorOnPath(ctx, err) +} + +func (ec *executionContext) marshalOString2ᚖstring(ctx context.Context, sel ast.SelectionSet, v *string) graphql.Marshaler { + if v == nil { + return graphql.Null + } + res := graphql.MarshalString(*v) + return res +} + +func (ec *executionContext) marshalO__EnumValue2ᚕgithubᚗcomᚋ99designsᚋgqlgenᚋgraphqlᚋintrospectionᚐEnumValueᚄ(ctx context.Context, sel ast.SelectionSet, v []introspection.EnumValue) graphql.Marshaler { + if v == nil { + return graphql.Null + } + ret := make(graphql.Array, len(v)) + var wg sync.WaitGroup + isLen1 := len(v) == 1 + if !isLen1 { + wg.Add(len(v)) + } + for i := range v { + i := i + fc := &graphql.FieldContext{ + Index: &i, + Result: &v[i], + } + ctx := graphql.WithFieldContext(ctx, fc) + f := func(i int) { + defer func() { + if r := recover(); r != nil { + ec.Error(ctx, ec.Recover(ctx, r)) + ret = nil + } + }() + if !isLen1 { + defer wg.Done() + } + ret[i] = ec.marshalN__EnumValue2githubᚗcomᚋ99designsᚋgqlgenᚋgraphqlᚋintrospectionᚐEnumValue(ctx, sel, v[i]) + } + if isLen1 { + f(i) + } else { + go f(i) + } + + } + wg.Wait() + + for _, e := range ret { + if e == graphql.Null { + return graphql.Null + } + } + + return ret +} + +func (ec *executionContext) marshalO__Field2ᚕgithubᚗcomᚋ99designsᚋgqlgenᚋgraphqlᚋintrospectionᚐFieldᚄ(ctx context.Context, sel ast.SelectionSet, v []introspection.Field) graphql.Marshaler { + if v == nil { + return graphql.Null + } + ret := make(graphql.Array, len(v)) + var wg sync.WaitGroup + isLen1 := len(v) == 1 + if !isLen1 { + wg.Add(len(v)) + } + for i := range v { + i := i + fc := &graphql.FieldContext{ + Index: &i, + Result: &v[i], + } + ctx := graphql.WithFieldContext(ctx, fc) + f := func(i int) { + defer func() { + if r := recover(); r != nil { + ec.Error(ctx, ec.Recover(ctx, r)) + ret = nil + } + }() + if !isLen1 { + defer wg.Done() + } + ret[i] = ec.marshalN__Field2githubᚗcomᚋ99designsᚋgqlgenᚋgraphqlᚋintrospectionᚐField(ctx, sel, v[i]) + } + if isLen1 { + f(i) + } else { + go f(i) + } + + } + wg.Wait() + + for _, e := range ret { + if e == graphql.Null { + return graphql.Null + } + } + + return ret +} + +func (ec *executionContext) marshalO__InputValue2ᚕgithubᚗcomᚋ99designsᚋgqlgenᚋgraphqlᚋintrospectionᚐInputValueᚄ(ctx context.Context, sel ast.SelectionSet, v []introspection.InputValue) graphql.Marshaler { + if v == nil { + return graphql.Null + } + ret := make(graphql.Array, len(v)) + var wg sync.WaitGroup + isLen1 := len(v) == 1 + if !isLen1 { + wg.Add(len(v)) + } + for i := range v { + i := i + fc := &graphql.FieldContext{ + Index: &i, + Result: &v[i], + } + ctx := graphql.WithFieldContext(ctx, fc) + f := func(i int) { + defer func() { + if r := recover(); r != nil { + ec.Error(ctx, ec.Recover(ctx, r)) + ret = nil + } + }() + if !isLen1 { + defer wg.Done() + } + ret[i] = ec.marshalN__InputValue2githubᚗcomᚋ99designsᚋgqlgenᚋgraphqlᚋintrospectionᚐInputValue(ctx, sel, v[i]) + } + if isLen1 { + f(i) + } else { + go f(i) + } + + } + wg.Wait() + + for _, e := range ret { + if e == graphql.Null { + return graphql.Null + } + } + + return ret +} + +func (ec *executionContext) marshalO__Schema2ᚖgithubᚗcomᚋ99designsᚋgqlgenᚋgraphqlᚋintrospectionᚐSchema(ctx context.Context, sel ast.SelectionSet, v *introspection.Schema) graphql.Marshaler { + if v == nil { + return graphql.Null + } + return ec.___Schema(ctx, sel, v) +} + +func (ec *executionContext) marshalO__Type2ᚕgithubᚗcomᚋ99designsᚋgqlgenᚋgraphqlᚋintrospectionᚐTypeᚄ(ctx context.Context, sel ast.SelectionSet, v []introspection.Type) graphql.Marshaler { + if v == nil { + return graphql.Null + } + ret := make(graphql.Array, len(v)) + var wg sync.WaitGroup + isLen1 := len(v) == 1 + if !isLen1 { + wg.Add(len(v)) + } + for i := range v { + i := i + fc := &graphql.FieldContext{ + Index: &i, + Result: &v[i], + } + ctx := graphql.WithFieldContext(ctx, fc) + f := func(i int) { + defer func() { + if r := recover(); r != nil { + ec.Error(ctx, ec.Recover(ctx, r)) + ret = nil + } + }() + if !isLen1 { + defer wg.Done() + } + ret[i] = ec.marshalN__Type2githubᚗcomᚋ99designsᚋgqlgenᚋgraphqlᚋintrospectionᚐType(ctx, sel, v[i]) + } + if isLen1 { + f(i) + } else { + go f(i) + } + + } + wg.Wait() + + for _, e := range ret { + if e == graphql.Null { + return graphql.Null + } + } + + return ret +} + +func (ec *executionContext) marshalO__Type2ᚖgithubᚗcomᚋ99designsᚋgqlgenᚋgraphqlᚋintrospectionᚐType(ctx context.Context, sel ast.SelectionSet, v *introspection.Type) graphql.Marshaler { + if v == nil { + return graphql.Null + } + return ec.___Type(ctx, sel, v) +} + +// endregion ***************************** type.gotpl ***************************** diff --git a/frontend/graph/model/destination.go b/frontend/graph/model/destination.go new file mode 100644 index 000000000..5f2890a08 --- /dev/null +++ b/frontend/graph/model/destination.go @@ -0,0 +1,48 @@ +package model + +import ( + "github.com/odigos-io/odigos/common" + metav1 "k8s.io/apimachinery/pkg/apis/meta/v1" +) + +type GetDestinationTypesResponse struct { + Categories []DestinationsCategory `json:"categories"` +} + +type DestinationTypesCategoryItem struct { + Type string `json:"type"` + DisplayName string `json:"display_name"` + ImageUrl string `json:"image_url"` + SupportedSignals SupportedSignals `json:"supported_signals"` + TestConnectionSupported bool `json:"test_connection_supported"` +} + +type SupportedSignals struct { + Traces ObservabilitySignalSupport `json:"traces"` + Metrics ObservabilitySignalSupport `json:"metrics"` + Logs ObservabilitySignalSupport `json:"logs"` +} + +type ObservabilitySignalSupport struct { + Supported bool `json:"supported"` +} +type DestinationsCategory struct { + Name string `json:"name"` + Items []DestinationTypesCategoryItem `json:"items"` +} + +type ExportedSignals struct { + Traces bool `json:"traces"` + Metrics bool `json:"metrics"` + Logs bool `json:"logs"` +} + +type Destination struct { + Id string `json:"id"` + Name string `json:"name"` + Type common.DestinationType `json:"type"` + ExportedSignals ExportedSignals `json:"signals"` + Fields string `json:"fields"` + DestinationType DestinationTypesCategoryItem `json:"destination_type"` + Conditions []metav1.Condition `json:"conditions,omitempty"` +} diff --git a/frontend/graph/model/models_gen.go b/frontend/graph/model/models_gen.go new file mode 100644 index 000000000..27374cf6b --- /dev/null +++ b/frontend/graph/model/models_gen.go @@ -0,0 +1,471 @@ +// Code generated by github.com/99designs/gqlgen, DO NOT EDIT. + +package model + +import ( + "fmt" + "io" + "strconv" +) + +type ComputePlatform struct { + ComputePlatformType ComputePlatformType `json:"computePlatformType"` + K8sActualNamespace *K8sActualNamespace `json:"k8sActualNamespace,omitempty"` + K8sActualNamespaces []*K8sActualNamespace `json:"k8sActualNamespaces"` + K8sActualSource *K8sActualSource `json:"k8sActualSource,omitempty"` + K8sActualSources []*K8sActualSource `json:"k8sActualSources"` + Destinations []*Destination `json:"destinations"` + Actions []*IcaInstanceResponse `json:"actions"` +} + +type Condition struct { + Type string `json:"type"` + Status ConditionStatus `json:"status"` + LastTransitionTime *string `json:"lastTransitionTime,omitempty"` + Reason *string `json:"reason,omitempty"` + Message *string `json:"message,omitempty"` +} + +type DestinationDetails struct { + Type string `json:"type"` + URLString string `json:"urlString"` + Fields string `json:"fields"` +} + +type DestinationInput struct { + Name string `json:"name"` + Type string `json:"type"` + ExportedSignals *ExportedSignalsInput `json:"exportedSignals"` + Fields []*FieldInput `json:"fields"` +} + +type ExportedSignalsInput struct { + Traces bool `json:"traces"` + Metrics bool `json:"metrics"` + Logs bool `json:"logs"` +} + +type Field struct { + Name string `json:"name"` + DisplayName string `json:"displayName"` + ComponentType string `json:"componentType"` + ComponentProperties string `json:"componentProperties"` + VideoURL *string `json:"videoUrl,omitempty"` + ThumbnailURL *string `json:"thumbnailURL,omitempty"` + InitialValue *string `json:"initialValue,omitempty"` +} + +type FieldInput struct { + Key string `json:"key"` + Value string `json:"value"` +} + +type GetConfigResponse struct { + Installation InstallationStatus `json:"installation"` +} + +type GetDestinationDetailsResponse struct { + Fields []*Field `json:"fields"` +} + +type IcaInstanceResponse struct { + ID string `json:"id"` + Type string `json:"type"` + Spec string `json:"spec"` +} + +type InstrumentationLibrary struct { + LibraryName string `json:"libraryName"` + Options []*InstrumentationOption `json:"options"` +} + +type InstrumentationOption struct { + OptionKey string `json:"optionKey"` + SpanKind SpanKind `json:"spanKind"` +} + +type InstrumentedApplicationDetails struct { + Containers []*SourceContainerRuntimeDetails `json:"containers,omitempty"` + Conditions []*Condition `json:"conditions,omitempty"` + InstrumentationOptions []*InstrumentationLibrary `json:"instrumentationOptions"` +} + +type K8sActualNamespace struct { + Name string `json:"name"` + InstrumentationLabelEnabled *bool `json:"instrumentationLabelEnabled,omitempty"` + K8sActualSources []*K8sActualSource `json:"k8sActualSources"` +} + +type K8sActualSource struct { + Namespace string `json:"namespace"` + Kind K8sResourceKind `json:"kind"` + Name string `json:"name"` + ServiceName *string `json:"serviceName,omitempty"` + NumberOfInstances *int `json:"numberOfInstances,omitempty"` + ReportedName *string `json:"reportedName,omitempty"` + AutoInstrumented bool `json:"autoInstrumented"` + AutoInstrumentedDecision string `json:"autoInstrumentedDecision"` + InstrumentedApplicationDetails *InstrumentedApplicationDetails `json:"instrumentedApplicationDetails,omitempty"` +} + +type K8sDesiredNamespaceInput struct { + AutoInstrument *bool `json:"autoInstrument,omitempty"` +} + +type K8sDesiredSourceInput struct { + ServiceName *string `json:"serviceName,omitempty"` + AutoInstrument *bool `json:"autoInstrument,omitempty"` +} + +type K8sNamespaceID struct { + Name string `json:"name"` +} + +type K8sSourceID struct { + Namespace string `json:"namespace"` + Kind K8sResourceKind `json:"kind"` + Name string `json:"name"` +} + +type Mutation struct { +} + +type PatchSourceRequestInput struct { + ReportedName *string `json:"reportedName,omitempty"` +} + +type PersistNamespaceItemInput struct { + Name string `json:"name"` + FutureSelected *bool `json:"futureSelected,omitempty"` +} + +type PersistNamespaceSourceInput struct { + Name string `json:"name"` + Kind K8sResourceKind `json:"kind"` + Selected *bool `json:"selected,omitempty"` +} + +type Query struct { +} + +type SourceContainerRuntimeDetails struct { + ContainerName string `json:"containerName"` + Language string `json:"language"` +} + +type TestConnectionResponse struct { + Succeeded bool `json:"succeeded"` + StatusCode int `json:"statusCode"` + DestinationType *string `json:"destinationType,omitempty"` + Message *string `json:"message,omitempty"` + Reason *string `json:"reason,omitempty"` +} + +type ComputePlatformType string + +const ( + ComputePlatformTypeK8s ComputePlatformType = "K8S" + ComputePlatformTypeVM ComputePlatformType = "VM" +) + +var AllComputePlatformType = []ComputePlatformType{ + ComputePlatformTypeK8s, + ComputePlatformTypeVM, +} + +func (e ComputePlatformType) IsValid() bool { + switch e { + case ComputePlatformTypeK8s, ComputePlatformTypeVM: + return true + } + return false +} + +func (e ComputePlatformType) String() string { + return string(e) +} + +func (e *ComputePlatformType) UnmarshalGQL(v interface{}) error { + str, ok := v.(string) + if !ok { + return fmt.Errorf("enums must be strings") + } + + *e = ComputePlatformType(str) + if !e.IsValid() { + return fmt.Errorf("%s is not a valid ComputePlatformType", str) + } + return nil +} + +func (e ComputePlatformType) MarshalGQL(w io.Writer) { + fmt.Fprint(w, strconv.Quote(e.String())) +} + +type ConditionStatus string + +const ( + ConditionStatusTrue ConditionStatus = "True" + ConditionStatusFalse ConditionStatus = "False" + ConditionStatusUnknown ConditionStatus = "Unknown" +) + +var AllConditionStatus = []ConditionStatus{ + ConditionStatusTrue, + ConditionStatusFalse, + ConditionStatusUnknown, +} + +func (e ConditionStatus) IsValid() bool { + switch e { + case ConditionStatusTrue, ConditionStatusFalse, ConditionStatusUnknown: + return true + } + return false +} + +func (e ConditionStatus) String() string { + return string(e) +} + +func (e *ConditionStatus) UnmarshalGQL(v interface{}) error { + str, ok := v.(string) + if !ok { + return fmt.Errorf("enums must be strings") + } + + *e = ConditionStatus(str) + if !e.IsValid() { + return fmt.Errorf("%s is not a valid ConditionStatus", str) + } + return nil +} + +func (e ConditionStatus) MarshalGQL(w io.Writer) { + fmt.Fprint(w, strconv.Quote(e.String())) +} + +type InstallationStatus string + +const ( + InstallationStatusNew InstallationStatus = "NEW" + InstallationStatusAppsSelected InstallationStatus = "APPS_SELECTED" + InstallationStatusFinished InstallationStatus = "FINISHED" +) + +var AllInstallationStatus = []InstallationStatus{ + InstallationStatusNew, + InstallationStatusAppsSelected, + InstallationStatusFinished, +} + +func (e InstallationStatus) IsValid() bool { + switch e { + case InstallationStatusNew, InstallationStatusAppsSelected, InstallationStatusFinished: + return true + } + return false +} + +func (e InstallationStatus) String() string { + return string(e) +} + +func (e *InstallationStatus) UnmarshalGQL(v interface{}) error { + str, ok := v.(string) + if !ok { + return fmt.Errorf("enums must be strings") + } + + *e = InstallationStatus(str) + if !e.IsValid() { + return fmt.Errorf("%s is not a valid InstallationStatus", str) + } + return nil +} + +func (e InstallationStatus) MarshalGQL(w io.Writer) { + fmt.Fprint(w, strconv.Quote(e.String())) +} + +type K8sResourceKind string + +const ( + K8sResourceKindDeployment K8sResourceKind = "Deployment" + K8sResourceKindDaemonSet K8sResourceKind = "DaemonSet" + K8sResourceKindStatefulSet K8sResourceKind = "StatefulSet" +) + +var AllK8sResourceKind = []K8sResourceKind{ + K8sResourceKindDeployment, + K8sResourceKindDaemonSet, + K8sResourceKindStatefulSet, +} + +func (e K8sResourceKind) IsValid() bool { + switch e { + case K8sResourceKindDeployment, K8sResourceKindDaemonSet, K8sResourceKindStatefulSet: + return true + } + return false +} + +func (e K8sResourceKind) String() string { + return string(e) +} + +func (e *K8sResourceKind) UnmarshalGQL(v interface{}) error { + str, ok := v.(string) + if !ok { + return fmt.Errorf("enums must be strings") + } + + *e = K8sResourceKind(str) + if !e.IsValid() { + return fmt.Errorf("%s is not a valid K8sResourceKind", str) + } + return nil +} + +func (e K8sResourceKind) MarshalGQL(w io.Writer) { + fmt.Fprint(w, strconv.Quote(e.String())) +} + +type ProgrammingLanguage string + +const ( + ProgrammingLanguageUnspecified ProgrammingLanguage = "Unspecified" + ProgrammingLanguageJava ProgrammingLanguage = "Java" + ProgrammingLanguageGo ProgrammingLanguage = "Go" + ProgrammingLanguageJavaScript ProgrammingLanguage = "JavaScript" + ProgrammingLanguagePython ProgrammingLanguage = "Python" + ProgrammingLanguageDotNet ProgrammingLanguage = "DotNet" +) + +var AllProgrammingLanguage = []ProgrammingLanguage{ + ProgrammingLanguageUnspecified, + ProgrammingLanguageJava, + ProgrammingLanguageGo, + ProgrammingLanguageJavaScript, + ProgrammingLanguagePython, + ProgrammingLanguageDotNet, +} + +func (e ProgrammingLanguage) IsValid() bool { + switch e { + case ProgrammingLanguageUnspecified, ProgrammingLanguageJava, ProgrammingLanguageGo, ProgrammingLanguageJavaScript, ProgrammingLanguagePython, ProgrammingLanguageDotNet: + return true + } + return false +} + +func (e ProgrammingLanguage) String() string { + return string(e) +} + +func (e *ProgrammingLanguage) UnmarshalGQL(v interface{}) error { + str, ok := v.(string) + if !ok { + return fmt.Errorf("enums must be strings") + } + + *e = ProgrammingLanguage(str) + if !e.IsValid() { + return fmt.Errorf("%s is not a valid ProgrammingLanguage", str) + } + return nil +} + +func (e ProgrammingLanguage) MarshalGQL(w io.Writer) { + fmt.Fprint(w, strconv.Quote(e.String())) +} + +type SignalType string + +const ( + SignalTypeTraces SignalType = "TRACES" + SignalTypeMetrics SignalType = "METRICS" + SignalTypeLogs SignalType = "LOGS" +) + +var AllSignalType = []SignalType{ + SignalTypeTraces, + SignalTypeMetrics, + SignalTypeLogs, +} + +func (e SignalType) IsValid() bool { + switch e { + case SignalTypeTraces, SignalTypeMetrics, SignalTypeLogs: + return true + } + return false +} + +func (e SignalType) String() string { + return string(e) +} + +func (e *SignalType) UnmarshalGQL(v interface{}) error { + str, ok := v.(string) + if !ok { + return fmt.Errorf("enums must be strings") + } + + *e = SignalType(str) + if !e.IsValid() { + return fmt.Errorf("%s is not a valid SignalType", str) + } + return nil +} + +func (e SignalType) MarshalGQL(w io.Writer) { + fmt.Fprint(w, strconv.Quote(e.String())) +} + +type SpanKind string + +const ( + SpanKindInternal SpanKind = "Internal" + SpanKindServer SpanKind = "Server" + SpanKindClient SpanKind = "Client" + SpanKindProducer SpanKind = "Producer" + SpanKindConsumer SpanKind = "Consumer" +) + +var AllSpanKind = []SpanKind{ + SpanKindInternal, + SpanKindServer, + SpanKindClient, + SpanKindProducer, + SpanKindConsumer, +} + +func (e SpanKind) IsValid() bool { + switch e { + case SpanKindInternal, SpanKindServer, SpanKindClient, SpanKindProducer, SpanKindConsumer: + return true + } + return false +} + +func (e SpanKind) String() string { + return string(e) +} + +func (e *SpanKind) UnmarshalGQL(v interface{}) error { + str, ok := v.(string) + if !ok { + return fmt.Errorf("enums must be strings") + } + + *e = SpanKind(str) + if !e.IsValid() { + return fmt.Errorf("%s is not a valid SpanKind", str) + } + return nil +} + +func (e SpanKind) MarshalGQL(w io.Writer) { + fmt.Fprint(w, strconv.Quote(e.String())) +} diff --git a/frontend/graph/resolver.go b/frontend/graph/resolver.go new file mode 100644 index 000000000..a25c09c61 --- /dev/null +++ b/frontend/graph/resolver.go @@ -0,0 +1,7 @@ +package graph + +// This file will not be regenerated automatically. +// +// It serves as dependency injection for your app, add any dependencies you require here. + +type Resolver struct{} diff --git a/frontend/graph/schema.graphqls b/frontend/graph/schema.graphqls new file mode 100644 index 000000000..666582cb9 --- /dev/null +++ b/frontend/graph/schema.graphqls @@ -0,0 +1,264 @@ +enum ComputePlatformType { + K8S + VM +} + +enum K8sResourceKind { + Deployment + DaemonSet + StatefulSet +} + +enum ConditionStatus { + True + False + Unknown +} + +enum ProgrammingLanguage { + Unspecified + Java + Go + JavaScript + Python + DotNet +} + +enum SignalType { + TRACES + METRICS + LOGS +} + +enum SpanKind { + Internal + Server + Client + Producer + Consumer +} + +enum InstallationStatus { + NEW + APPS_SELECTED + FINISHED +} + +type SourceContainerRuntimeDetails { + containerName: String! + language: String! +} + +type InstrumentationOption { + optionKey: String! + spanKind: SpanKind! +} + +type InstrumentationLibrary { + libraryName: String! + options: [InstrumentationOption!]! +} + +type InstrumentedApplicationDetails { + containers: [SourceContainerRuntimeDetails!] + conditions: [Condition!] + instrumentationOptions: [InstrumentationLibrary!]! +} + +type Condition { + type: String! + status: ConditionStatus! + lastTransitionTime: String + reason: String + message: String +} + +type K8sActualNamespace { + name: String! + instrumentationLabelEnabled: Boolean + k8sActualSources(instrumentationLabeled: Boolean): [K8sActualSource]! +} + +input K8sDesiredNamespaceInput { + autoInstrument: Boolean +} + +input K8sNamespaceId { + name: String! +} + +type K8sActualSource { + namespace: String! + kind: K8sResourceKind! + name: String! + serviceName: String + numberOfInstances: Int + reportedName: String + autoInstrumented: Boolean! + autoInstrumentedDecision: String! + instrumentedApplicationDetails: InstrumentedApplicationDetails +} + +input K8sDesiredSourceInput { + serviceName: String + autoInstrument: Boolean +} + +input K8sSourceId { + namespace: String! + kind: K8sResourceKind! + name: String! +} + +type ComputePlatform { + computePlatformType: ComputePlatformType! + k8sActualNamespace(name: String!): K8sActualNamespace + k8sActualNamespaces: [K8sActualNamespace]! + k8sActualSource( + name: String + namespace: String + kind: String + ): K8sActualSource + k8sActualSources: [K8sActualSource]! + destinations: [Destination!]! + actions: [IcaInstanceResponse!]! +} + +type SupportedSignals { + traces: ObservabilitySignalSupport! + metrics: ObservabilitySignalSupport! + logs: ObservabilitySignalSupport! +} + +type ObservabilitySignalSupport { + supported: Boolean! +} + +type DestinationTypesCategoryItem { + type: String! + displayName: String! + imageUrl: String! + supportedSignals: SupportedSignals! + testConnectionSupported: Boolean! +} + +type DestinationsCategory { + name: String! + items: [DestinationTypesCategoryItem!]! +} + +type GetDestinationTypesResponse { + categories: [DestinationsCategory!]! +} + +type ExportedSignals { + traces: Boolean! + metrics: Boolean! + logs: Boolean! +} + +type Destination { + id: ID! + name: String! + type: String! + exportedSignals: ExportedSignals! + fields: String! + destinationType: DestinationTypesCategoryItem! + conditions: [Condition!] +} + +type GetConfigResponse { + installation: InstallationStatus! +} + +type Field { + name: String! + displayName: String! + componentType: String! + componentProperties: String! # Using String to store JSON data as a string + videoUrl: String + thumbnailURL: String + initialValue: String +} + +type GetDestinationDetailsResponse { + fields: [Field!]! +} + +input DestinationInput { + name: String! + type: String! + exportedSignals: ExportedSignalsInput! + fields: [FieldInput!]! +} + +input FieldInput { + key: String! + value: String! +} + +input ExportedSignalsInput { + traces: Boolean! + metrics: Boolean! + logs: Boolean! +} + +input PersistNamespaceItemInput { + name: String! + futureSelected: Boolean +} + +input PersistNamespaceSourceInput { + name: String! + kind: K8sResourceKind! + selected: Boolean +} + +type TestConnectionResponse { + succeeded: Boolean! + statusCode: Int! + destinationType: String + message: String + reason: String +} + +type DestinationDetails { + type: String! + urlString: String! + fields: String! +} + +type IcaInstanceResponse { + id: String! + type: String! + spec: String! +} + +input PatchSourceRequestInput { + reportedName: String +} + +type Query { + computePlatform: ComputePlatform + config: GetConfigResponse + destinationTypes: GetDestinationTypesResponse + destinationTypeDetails(type: String!): GetDestinationDetailsResponse + potentialDestinations: [DestinationDetails!]! +} + +type Mutation { + createNewDestination(destination: DestinationInput!): Destination! + persistK8sNamespace(namespace: PersistNamespaceItemInput!): Boolean! + persistK8sSources( + namespace: String! + sources: [PersistNamespaceSourceInput!]! + ): Boolean! + testConnectionForDestination( + destination: DestinationInput! + ): TestConnectionResponse! + updateK8sActualSource( + sourceId: K8sSourceId! + patchSourceRequest: PatchSourceRequestInput! + ): Boolean! + updateDestination(id: ID!, destination: DestinationInput!): Destination! +} diff --git a/frontend/graph/schema.resolvers.go b/frontend/graph/schema.resolvers.go new file mode 100644 index 000000000..9fbfff584 --- /dev/null +++ b/frontend/graph/schema.resolvers.go @@ -0,0 +1,655 @@ +package graph + +// This file will be automatically regenerated based on the schema, any resolver implementations +// will be copied through when generating and any unknown code will be moved to the end. +// Code generated by github.com/99designs/gqlgen version v0.17.49 + +import ( + "context" + "encoding/json" + "fmt" + + "github.com/odigos-io/odigos/api/odigos/v1alpha1" + "github.com/odigos-io/odigos/common" + "github.com/odigos-io/odigos/common/consts" + "github.com/odigos-io/odigos/frontend/endpoints" + "github.com/odigos-io/odigos/frontend/graph/model" + "github.com/odigos-io/odigos/frontend/kube" + "github.com/odigos-io/odigos/frontend/services" + testconnection "github.com/odigos-io/odigos/frontend/services/test_connection" + "github.com/odigos-io/odigos/k8sutils/pkg/workload" + metav1 "k8s.io/apimachinery/pkg/apis/meta/v1" + "k8s.io/apimachinery/pkg/types" +) + +// K8sActualNamespace is the resolver for the k8sActualNamespace field. +func (r *computePlatformResolver) K8sActualNamespace(ctx context.Context, obj *model.ComputePlatform, name string) (*model.K8sActualNamespace, error) { + namespaceActualSources, err := services.GetWorkloadsInNamespace(ctx, name, nil) + if err != nil { + return nil, err + } + + // Convert namespaceActualSources to []*model.K8sActualSource + namespaceActualSourcesPointers := make([]*model.K8sActualSource, len(namespaceActualSources)) + for i, source := range namespaceActualSources { + namespaceActualSourcesPointers[i] = &source + } + + namespace, err := kube.DefaultClient.CoreV1().Namespaces().Get(ctx, name, metav1.GetOptions{}) + if err != nil { + return nil, err + } + + nsInstrumented := workload.GetInstrumentationLabelValue(namespace.GetLabels()) + + return &model.K8sActualNamespace{ + Name: name, + InstrumentationLabelEnabled: nsInstrumented, + K8sActualSources: namespaceActualSourcesPointers, + }, nil +} + +// K8sActualNamespaces is the resolver for the k8sActualNamespaces field. +func (r *computePlatformResolver) K8sActualNamespaces(ctx context.Context, obj *model.ComputePlatform) ([]*model.K8sActualNamespace, error) { + namespacesResponse := services.GetK8SNamespaces(ctx) + + K8sActualNamespaces := make([]*model.K8sActualNamespace, len(namespacesResponse.Namespaces)) + for i, namespace := range namespacesResponse.Namespaces { + + namespace, err := kube.DefaultClient.CoreV1().Namespaces().Get(ctx, namespace.Name, metav1.GetOptions{}) + if err != nil { + return nil, err + } + + nsInstrumented := workload.GetInstrumentationLabelValue(namespace.GetLabels()) + + K8sActualNamespaces[i] = &model.K8sActualNamespace{ + Name: namespace.Name, + InstrumentationLabelEnabled: nsInstrumented, + } + } + + return K8sActualNamespaces, nil +} + +// K8sActualSource is the resolver for the k8sActualSource field. +func (r *computePlatformResolver) K8sActualSource(ctx context.Context, obj *model.ComputePlatform, name *string, namespace *string, kind *string) (*model.K8sActualSource, error) { + source, err := services.GetActualSource(ctx, *namespace, *kind, *name) + if err != nil { + return nil, err + } + if source == nil { + return nil, nil + } + k8sActualSource := k8sSourceToGql(source) + + return k8sActualSource, nil +} + +// K8sActualSources is the resolver for the k8sActualSources field. +func (r *computePlatformResolver) K8sActualSources(ctx context.Context, obj *model.ComputePlatform) ([]*model.K8sActualSource, error) { + instrumentedApplications, err := kube.DefaultClient.OdigosClient.InstrumentedApplications("").List(ctx, metav1.ListOptions{}) + if err != nil { + return nil, err + } + + // Initialize an empty list of K8sActualSource + var actualSources []*model.K8sActualSource + + // Convert each instrumented application to the K8sActualSource type + for _, app := range instrumentedApplications.Items { + actualSource := instrumentedApplicationToActualSource(app) + + owner, _ := services.GetWorkload(ctx, actualSource.Namespace, string(actualSource.Kind), actualSource.Name) + if owner == nil { + + continue + } + ownerAnnotations := owner.GetAnnotations() + var reportedName string + if ownerAnnotations != nil { + reportedName = ownerAnnotations[consts.OdigosReportedNameAnnotation] + } + actualSource.ReportedName = &reportedName + actualSources = append(actualSources, actualSource) + } + + return actualSources, nil +} + +// Destinations is the resolver for the destinations field. +func (r *computePlatformResolver) Destinations(ctx context.Context, obj *model.ComputePlatform) ([]*model.Destination, error) { + odigosns := consts.DefaultOdigosNamespace + dests, err := kube.DefaultClient.OdigosClient.Destinations(odigosns).List(ctx, metav1.ListOptions{}) + if err != nil { + return nil, err + } + + var destinations []*model.Destination + for _, dest := range dests.Items { + secretFields, err := services.GetDestinationSecretFields(ctx, odigosns, &dest) + if err != nil { + return nil, err + } + + // Convert the k8s destination format to the expected endpoint format + endpointDest := services.K8sDestinationToEndpointFormat(dest, secretFields) + destinations = append(destinations, &endpointDest) + } + + return destinations, nil +} + +// Actions is the resolver for the actions field. +func (r *computePlatformResolver) Actions(ctx context.Context, obj *model.ComputePlatform) ([]*model.IcaInstanceResponse, error) { + var response []*model.IcaInstanceResponse + odigosns := consts.DefaultOdigosNamespace + + // AddClusterInfos actions + icaActions, err := kube.DefaultClient.ActionsClient.AddClusterInfos(odigosns).List(ctx, metav1.ListOptions{}) + if err != nil { + return nil, err + } + for _, action := range icaActions.Items { + specStr, err := json.Marshal(action.Spec) // Convert spec to JSON string + if err != nil { + return nil, err + } + response = append(response, &model.IcaInstanceResponse{ + ID: action.Name, + Type: action.Kind, + Spec: string(specStr), // Return the JSON string + }) + } + + // DeleteAttributes actions + daActions, err := kube.DefaultClient.ActionsClient.DeleteAttributes(odigosns).List(ctx, metav1.ListOptions{}) + if err != nil { + return nil, err + } + for _, action := range daActions.Items { + specStr, err := json.Marshal(action.Spec) + if err != nil { + return nil, err + } + response = append(response, &model.IcaInstanceResponse{ + ID: action.Name, + Type: action.Kind, + Spec: string(specStr), + }) + } + + // RenameAttributes actions + raActions, err := kube.DefaultClient.ActionsClient.RenameAttributes(odigosns).List(ctx, metav1.ListOptions{}) + if err != nil { + return nil, err + } + for _, action := range raActions.Items { + specStr, err := json.Marshal(action.Spec) + if err != nil { + return nil, err + } + response = append(response, &model.IcaInstanceResponse{ + ID: action.Name, + Type: action.Kind, + Spec: string(specStr), + }) + } + + // ErrorSamplers actions + esActions, err := kube.DefaultClient.ActionsClient.ErrorSamplers(odigosns).List(ctx, metav1.ListOptions{}) + if err != nil { + return nil, err + } + for _, action := range esActions.Items { + specStr, err := json.Marshal(action.Spec) + if err != nil { + return nil, err + } + response = append(response, &model.IcaInstanceResponse{ + ID: action.Name, + Type: action.Kind, + Spec: string(specStr), + }) + } + + // LatencySamplers actions + lsActions, err := kube.DefaultClient.ActionsClient.LatencySamplers(odigosns).List(ctx, metav1.ListOptions{}) + if err != nil { + return nil, err + } + for _, action := range lsActions.Items { + specStr, err := json.Marshal(action.Spec) + if err != nil { + return nil, err + } + response = append(response, &model.IcaInstanceResponse{ + ID: action.Name, + Type: action.Kind, + Spec: string(specStr), + }) + } + + // ProbabilisticSamplers actions + psActions, err := kube.DefaultClient.ActionsClient.ProbabilisticSamplers(odigosns).List(ctx, metav1.ListOptions{}) + if err != nil { + return nil, err + } + for _, action := range psActions.Items { + specStr, err := json.Marshal(action.Spec) + if err != nil { + return nil, err + } + response = append(response, &model.IcaInstanceResponse{ + ID: action.Name, + Type: action.Kind, + Spec: string(specStr), + }) + } + + // PiiMaskings actions + piActions, err := kube.DefaultClient.ActionsClient.PiiMaskings(odigosns).List(ctx, metav1.ListOptions{}) + if err != nil { + return nil, err + } + for _, action := range piActions.Items { + specStr, err := json.Marshal(action.Spec) + if err != nil { + return nil, err + } + response = append(response, &model.IcaInstanceResponse{ + ID: action.Name, + Type: action.Kind, + Spec: string(specStr), + }) + } + + return response, nil +} + +// Type is the resolver for the type field. +func (r *destinationResolver) Type(ctx context.Context, obj *model.Destination) (string, error) { + panic(fmt.Errorf("not implemented: Type - type")) +} + +// Conditions is the resolver for the conditions field. +func (r *destinationResolver) Conditions(ctx context.Context, obj *model.Destination) ([]*model.Condition, error) { + panic(fmt.Errorf("not implemented: Conditions - conditions")) +} + +// K8sActualSources is the resolver for the k8sActualSources field. +func (r *k8sActualNamespaceResolver) K8sActualSources(ctx context.Context, obj *model.K8sActualNamespace, instrumentationLabeled *bool) ([]*model.K8sActualSource, error) { + namespaceActualSources, err := services.GetWorkloadsInNamespace(ctx, obj.Name, instrumentationLabeled) + if err != nil { + return nil, err + } + + // Convert namespaceActualSources to []*model.K8sActualSource + namespaceActualSourcesPointers := make([]*model.K8sActualSource, len(namespaceActualSources)) + for i, source := range namespaceActualSources { + namespaceActualSourcesPointers[i] = &source + } + + return namespaceActualSourcesPointers, nil +} + +// CreateNewDestination is the resolver for the createNewDestination field. +func (r *mutationResolver) CreateNewDestination(ctx context.Context, destination model.DestinationInput) (*model.Destination, error) { + odigosns := consts.DefaultOdigosNamespace + + destType := common.DestinationType(destination.Type) + destName := destination.Name + + destTypeConfig, err := services.GetDestinationTypeConfig(destType) + if err != nil { + return nil, fmt.Errorf("destination type %s not found", destType) + } + + // Convert fields to map[string]string + fieldsMap := make(map[string]string) + for _, field := range destination.Fields { + fieldsMap[field.Key] = field.Value + } + + errors := services.VerifyDestinationDataScheme(destType, destTypeConfig, fieldsMap) + if len(errors) > 0 { + return nil, fmt.Errorf("invalid destination data scheme: %v", errors) + } + + dataField, secretFields := services.TransformFieldsToDataAndSecrets(destTypeConfig, fieldsMap) + generateNamePrefix := "odigos.io.dest." + string(destType) + "-" + + k8sDestination := v1alpha1.Destination{ + ObjectMeta: metav1.ObjectMeta{ + GenerateName: generateNamePrefix, + }, + Spec: v1alpha1.DestinationSpec{ + Type: destType, + DestinationName: destName, + Data: dataField, + Signals: services.ExportedSignalsObjectToSlice(destination.ExportedSignals), + }, + } + + createSecret := len(secretFields) > 0 + if createSecret { + secretRef, err := services.CreateDestinationSecret(ctx, destType, secretFields, odigosns) + if err != nil { + return nil, err + } + k8sDestination.Spec.SecretRef = secretRef + } + + dest, err := kube.DefaultClient.OdigosClient.Destinations(odigosns).Create(ctx, &k8sDestination, metav1.CreateOptions{}) + if err != nil { + if createSecret { + kube.DefaultClient.CoreV1().Secrets(odigosns).Delete(ctx, destName, metav1.DeleteOptions{}) + } + return nil, err + } + + if dest.Spec.SecretRef != nil { + err = services.AddDestinationOwnerReferenceToSecret(ctx, odigosns, dest) + if err != nil { + return nil, err + } + } + + secretFieldsMap, err := services.GetDestinationSecretFields(ctx, odigosns, dest) + if err != nil { + return nil, err + } + + endpointDest := services.K8sDestinationToEndpointFormat(*dest, secretFieldsMap) + return &endpointDest, nil +} + +// PersistK8sNamespace is the resolver for the persistK8sNamespace field. +func (r *mutationResolver) PersistK8sNamespace(ctx context.Context, namespace model.PersistNamespaceItemInput) (bool, error) { + jsonMergePayload := services.GetJsonMergePatchForInstrumentationLabel(namespace.FutureSelected) + _, err := kube.DefaultClient.CoreV1().Namespaces().Patch(ctx, namespace.Name, types.MergePatchType, jsonMergePayload, metav1.PatchOptions{}) + if err != nil { + return false, fmt.Errorf("failed to patch namespace: %v", err) + } + + return true, nil +} + +// PersistK8sSources is the resolver for the persistK8sSources field. +func (r *mutationResolver) PersistK8sSources(ctx context.Context, namespace string, sources []*model.PersistNamespaceSourceInput) (bool, error) { + var persistObjects []model.PersistNamespaceSourceInput + for _, source := range sources { + persistObjects = append(persistObjects, model.PersistNamespaceSourceInput{ + Name: source.Name, + Kind: source.Kind, + Selected: source.Selected, + }) + } + + err := services.SyncWorkloadsInNamespace(ctx, namespace, persistObjects) + if err != nil { + return false, fmt.Errorf("failed to sync workloads: %v", err) + } + + return true, nil +} + +// TestConnectionForDestination is the resolver for the testConnectionForDestination field. +func (r *mutationResolver) TestConnectionForDestination(ctx context.Context, destination model.DestinationInput) (*model.TestConnectionResponse, error) { + destType := common.DestinationType(destination.Type) + + destConfig, err := services.GetDestinationTypeConfig(destType) + if err != nil { + return nil, err + } + + if !destConfig.Spec.TestConnectionSupported { + return nil, fmt.Errorf("destination type %s does not support test connection", destination.Type) + } + + configurer, err := testconnection.ConvertDestinationToConfigurer(destination) + if err != nil { + return nil, err + } + + res := testconnection.TestConnection(ctx, configurer) + if !res.Succeeded { + return &model.TestConnectionResponse{ + Succeeded: false, + StatusCode: res.StatusCode, + DestinationType: (*string)(&res.DestinationType), + Message: &res.Message, + Reason: (*string)(&res.Reason), + }, nil + } + + return &model.TestConnectionResponse{ + Succeeded: true, + StatusCode: 200, + DestinationType: (*string)(&res.DestinationType), + }, nil +} + +// UpdateK8sActualSource is the resolver for the updateK8sActualSource field. +func (r *mutationResolver) UpdateK8sActualSource(ctx context.Context, sourceID model.K8sSourceID, patchSourceRequest model.PatchSourceRequestInput) (bool, error) { + ns := sourceID.Namespace + kind := string(sourceID.Kind) + name := sourceID.Name + + request := patchSourceRequest + + // Handle ReportedName update + if request.ReportedName != nil { + if err := services.UpdateReportedName(ctx, ns, kind, name, *request.ReportedName); err != nil { + return false, err + } + } + + return true, nil +} + +// UpdateDestination is the resolver for the updateDestination field. +func (r *mutationResolver) UpdateDestination(ctx context.Context, id string, input model.DestinationInput) (*model.Destination, error) { + odigosns := consts.DefaultOdigosNamespace + + destType := common.DestinationType(input.Type) + destName := input.Name + + // Get the destination type configuration + destTypeConfig, err := services.GetDestinationTypeConfig(destType) + if err != nil { + return nil, fmt.Errorf("destination type %s not found: %v", destType, err) + } + + // Convert fields from input to map[string]string + fields := make(map[string]string) + for _, field := range input.Fields { + fields[field.Key] = field.Value + } + + // Validate the destination data schema + validationErrors := services.VerifyDestinationDataScheme(destType, destTypeConfig, fields) + if len(validationErrors) > 0 { + var errMsg string + for _, e := range validationErrors { + errMsg += e.Error() + "; " + } + return nil, fmt.Errorf("validation errors: %s", errMsg) + } + + // Separate data fields and secret fields + dataFields, secretFields := services.TransformFieldsToDataAndSecrets(destTypeConfig, fields) + + // Retrieve the existing destination + dest, err := kube.DefaultClient.OdigosClient.Destinations(odigosns).Get(ctx, id, metav1.GetOptions{}) + if err != nil { + return nil, fmt.Errorf("failed to get destination: %v", err) + } + + // Handle secrets + destUpdateHasSecrets := len(secretFields) > 0 + destCurrentlyHasSecrets := dest.Spec.SecretRef != nil + + if !destUpdateHasSecrets && destCurrentlyHasSecrets { + // Delete the secret if it's not needed anymore + err := kube.DefaultClient.CoreV1().Secrets(odigosns).Delete(ctx, dest.Spec.SecretRef.Name, metav1.DeleteOptions{}) + if err != nil { + return nil, fmt.Errorf("failed to delete secret: %v", err) + } + dest.Spec.SecretRef = nil + } else if destUpdateHasSecrets && !destCurrentlyHasSecrets { + // Create the secret if it was added in this update + secretRef, err := services.CreateDestinationSecret(ctx, destType, secretFields, odigosns) + if err != nil { + return nil, fmt.Errorf("failed to create secret: %v", err) + } + dest.Spec.SecretRef = secretRef + // Add owner reference to the secret + err = services.AddDestinationOwnerReferenceToSecret(ctx, odigosns, dest) + if err != nil { + return nil, fmt.Errorf("failed to add owner reference to secret: %v", err) + } + } else if destUpdateHasSecrets && destCurrentlyHasSecrets { + // Update the secret in case it is modified + secret, err := kube.DefaultClient.CoreV1().Secrets(odigosns).Get(ctx, dest.Spec.SecretRef.Name, metav1.GetOptions{}) + if err != nil { + return nil, fmt.Errorf("failed to get secret: %v", err) + } + origSecret := secret.DeepCopy() + + secret.StringData = secretFields + _, err = kube.DefaultClient.CoreV1().Secrets(odigosns).Update(ctx, secret, metav1.UpdateOptions{}) + if err != nil { + // Rollback secret if needed + _, rollbackErr := kube.DefaultClient.CoreV1().Secrets(odigosns).Update(ctx, origSecret, metav1.UpdateOptions{}) + if rollbackErr != nil { + fmt.Printf("Failed to rollback secret: %v\n", rollbackErr) + } + return nil, fmt.Errorf("failed to update secret: %v", err) + } + } + + // Update the destination specification + dest.Spec.Type = destType + dest.Spec.DestinationName = destName + dest.Spec.Data = dataFields + dest.Spec.Signals = services.ExportedSignalsObjectToSlice(input.ExportedSignals) + + // Update the destination in Kubernetes + updatedDest, err := kube.DefaultClient.OdigosClient.Destinations(odigosns).Update(ctx, dest, metav1.UpdateOptions{}) + if err != nil { + return nil, fmt.Errorf("failed to update destination: %v", err) + } + + // Get the secret fields for the updated destination + secretFields, err = services.GetDestinationSecretFields(ctx, odigosns, updatedDest) + if err != nil { + return nil, fmt.Errorf("failed to get secret fields: %v", err) + } + + // Convert the updated destination to the GraphQL model + resp := services.K8sDestinationToEndpointFormat(*updatedDest, secretFields) + + return &resp, nil +} + +// ComputePlatform is the resolver for the computePlatform field. +func (r *queryResolver) ComputePlatform(ctx context.Context) (*model.ComputePlatform, error) { + return &model.ComputePlatform{ + ComputePlatformType: model.ComputePlatformTypeK8s, + }, nil +} + +// Config is the resolver for the config field. +func (r *queryResolver) Config(ctx context.Context) (*model.GetConfigResponse, error) { + response := endpoints.GetConfig(ctx) + + gqlResponse := &model.GetConfigResponse{ + Installation: model.InstallationStatus(response.Installation), + } + + return gqlResponse, nil +} + +// DestinationTypes is the resolver for the destinationTypes field. +func (r *queryResolver) DestinationTypes(ctx context.Context) (*model.GetDestinationTypesResponse, error) { + destTypes := services.GetDestinationTypes() + + return &destTypes, nil +} + +// DestinationTypeDetails is the resolver for the destinationTypeDetails field. +func (r *queryResolver) DestinationTypeDetails(ctx context.Context, typeArg string) (*model.GetDestinationDetailsResponse, error) { + destType := common.DestinationType(typeArg) + destTypeConfig, err := services.GetDestinationTypeConfig(destType) + if err != nil { + return nil, fmt.Errorf("destination type %s not found", destType) + } + + var resp model.GetDestinationDetailsResponse + for _, field := range destTypeConfig.Spec.Fields { + componentPropsJSON, err := json.Marshal(field.ComponentProps) + if err != nil { + return nil, fmt.Errorf("error marshalling component properties: %v", err) + } + + resp.Fields = append(resp.Fields, &model.Field{ + Name: field.Name, + DisplayName: field.DisplayName, + ComponentType: field.ComponentType, + ComponentProperties: string(componentPropsJSON), + InitialValue: &field.InitialValue, + }) + + } + + return &resp, nil +} + +// PotentialDestinations is the resolver for the potentialDestinations field. +func (r *queryResolver) PotentialDestinations(ctx context.Context) ([]*model.DestinationDetails, error) { + potentialDestinations := services.PotentialDestinations(ctx) + if potentialDestinations == nil { + return nil, fmt.Errorf("failed to fetch potential destinations") + } + + // Convert []destination_recognition.DestinationDetails to []*DestinationDetails + var result []*model.DestinationDetails + for _, dest := range potentialDestinations { + + fieldsString, err := json.Marshal(dest.Fields) + if err != nil { + return nil, fmt.Errorf("error marshalling fields: %v", err) + } + + result = append(result, &model.DestinationDetails{ + Type: string(dest.Type), + Fields: string(fieldsString), + }) + } + + return result, nil +} + +// ComputePlatform returns ComputePlatformResolver implementation. +func (r *Resolver) ComputePlatform() ComputePlatformResolver { return &computePlatformResolver{r} } + +// Destination returns DestinationResolver implementation. +func (r *Resolver) Destination() DestinationResolver { return &destinationResolver{r} } + +// K8sActualNamespace returns K8sActualNamespaceResolver implementation. +func (r *Resolver) K8sActualNamespace() K8sActualNamespaceResolver { + return &k8sActualNamespaceResolver{r} +} + +// Mutation returns MutationResolver implementation. +func (r *Resolver) Mutation() MutationResolver { return &mutationResolver{r} } + +// Query returns QueryResolver implementation. +func (r *Resolver) Query() QueryResolver { return &queryResolver{r} } + +type computePlatformResolver struct{ *Resolver } +type destinationResolver struct{ *Resolver } +type k8sActualNamespaceResolver struct{ *Resolver } +type mutationResolver struct{ *Resolver } +type queryResolver struct{ *Resolver } diff --git a/frontend/main.go b/frontend/main.go index 64777fa68..6879dc21c 100644 --- a/frontend/main.go +++ b/frontend/main.go @@ -34,6 +34,10 @@ import ( "github.com/odigos-io/odigos/frontend/endpoints" _ "net/http/pprof" + + "github.com/99designs/gqlgen/graphql/handler" + "github.com/99designs/gqlgen/graphql/playground" + "github.com/odigos-io/odigos/frontend/graph" ) const ( @@ -110,7 +114,6 @@ func startHTTPServer(flags *Flags, odigosMetrics *collectormetrics.OdigosMetrics apis.PATCH("/sources/namespace/:namespace/kind/:kind/name/:name", endpoints.PatchSource) apis.GET("/applications/:namespace", endpoints.GetApplicationsInNamespace) - apis.GET("/config", endpoints.GetConfig) apis.GET("/destination-types", endpoints.GetDestinationTypes) apis.GET("/destination-types/:type", endpoints.GetDestinationTypeDetails) apis.GET("/destinations", func(c *gin.Context) { endpoints.GetDestinations(c, flags.Namespace) }) @@ -186,6 +189,13 @@ func startHTTPServer(flags *Flags, odigosMetrics *collectormetrics.OdigosMetrics apis.DELETE("/actions/types/PiiMasking/:id", func(c *gin.Context) { actions.DeletePiiMasking(c, flags.Namespace, c.Param("id")) }) } + // GraphQL handlers + gqlHandler := handler.NewDefaultServer(graph.NewExecutableSchema(graph.Config{Resolvers: &graph.Resolver{}})) + r.POST("/graphql", func(c *gin.Context) { + gqlHandler.ServeHTTP(c.Writer, c.Request) + }) + r.GET("/playground", gin.WrapH(playground.Handler("GraphQL Playground", "/graphql"))) + return r, nil } diff --git a/frontend/services/destination_recognition/destination_finder.go b/frontend/services/destination_recognition/destination_finder.go new file mode 100644 index 000000000..20258eff7 --- /dev/null +++ b/frontend/services/destination_recognition/destination_finder.go @@ -0,0 +1,79 @@ +package destination_recognition + +import ( + "context" + + odigosv1 "github.com/odigos-io/odigos/api/odigos/v1alpha1" + "github.com/odigos-io/odigos/common" + "github.com/odigos-io/odigos/frontend/kube" + "github.com/odigos-io/odigos/k8sutils/pkg/client" + k8s "k8s.io/api/core/v1" + metav1 "k8s.io/apimachinery/pkg/apis/meta/v1" +) + +var SupportedDestinationType = []common.DestinationType{common.JaegerDestinationType, common.ElasticsearchDestinationType} + +type DestinationDetails struct { + Type common.DestinationType `json:"type"` + Fields map[string]string `json:"fields"` +} + +type IDestinationFinder interface { + isPotentialService(k8s.Service) bool + fetchDestinationDetails(k8s.Service) DestinationDetails + getServiceURL() string +} + +func GetAllPotentialDestinationDetails(ctx context.Context, namespaces []k8s.Namespace, dests *odigosv1.DestinationList) ([]DestinationDetails, error) { + var destinationFinder IDestinationFinder + var destinationDetails []DestinationDetails + var err error + + for _, ns := range namespaces { + err = client.ListWithPages(client.DefaultPageSize, kube.DefaultClient.CoreV1().Services(ns.Name).List, + ctx, metav1.ListOptions{}, func(services *k8s.ServiceList) error { + for _, service := range services.Items { + for _, destinationType := range SupportedDestinationType { + destinationFinder = getDestinationFinder(destinationType) + + if destinationFinder.isPotentialService(service) { + potentialDestination := destinationFinder.fetchDestinationDetails(service) + + if !destinationExist(dests, potentialDestination, destinationFinder) { + destinationDetails = append(destinationDetails, potentialDestination) + } + break + } + } + } + return nil + }) + } + + if err != nil { + return nil, err + } + + return destinationDetails, nil +} + +func getDestinationFinder(destinationType common.DestinationType) IDestinationFinder { + switch destinationType { + case common.JaegerDestinationType: + return &JaegerDestinationFinder{} + case common.ElasticsearchDestinationType: + return &ElasticSearchDestinationFinder{} + } + + return nil +} + +func destinationExist(dests *odigosv1.DestinationList, potentialDestination DestinationDetails, destinationFinder IDestinationFinder) bool { + for _, dest := range dests.Items { + if dest.Spec.Type == potentialDestination.Type && dest.GetConfig()[destinationFinder.getServiceURL()] == potentialDestination.Fields[destinationFinder.getServiceURL()] { + return true + } + } + + return false +} diff --git a/frontend/services/destination_recognition/elasticsearch.go b/frontend/services/destination_recognition/elasticsearch.go new file mode 100644 index 000000000..38c3e7093 --- /dev/null +++ b/frontend/services/destination_recognition/elasticsearch.go @@ -0,0 +1,45 @@ +package destination_recognition + +import ( + "fmt" + "strings" + + "github.com/odigos-io/odigos/common" + "github.com/odigos-io/odigos/common/config" + k8s "k8s.io/api/core/v1" +) + +type ElasticSearchDestinationFinder struct{} + +const ElasticSearchHttpPort int32 = 9200 +const ElasticSearchHttpUrlFormat = "https://%s.%s:%d" + +func (j *ElasticSearchDestinationFinder) isPotentialService(service k8s.Service) bool { + for _, port := range service.Spec.Ports { + if isElasticSearchService(port.Port, service.Name) { + return true + } + } + + return false +} + +func isElasticSearchService(portNumber int32, name string) bool { + return portNumber == ElasticSearchHttpPort && strings.Contains(name, string(common.ElasticsearchDestinationType)) +} + +func (j *ElasticSearchDestinationFinder) fetchDestinationDetails(service k8s.Service) DestinationDetails { + urlString := fmt.Sprintf(ElasticSearchHttpUrlFormat, service.Name, service.Namespace, ElasticSearchHttpPort) + elasticServiceURL := j.getServiceURL() + fields := make(map[string]string) + fields[elasticServiceURL] = urlString + + return DestinationDetails{ + Type: common.ElasticsearchDestinationType, + Fields: fields, + } +} + +func (j *ElasticSearchDestinationFinder) getServiceURL() string { + return config.ElasticsearchUrlKey +} diff --git a/frontend/services/destination_recognition/jaeger.go b/frontend/services/destination_recognition/jaeger.go new file mode 100644 index 000000000..f66fd9bdd --- /dev/null +++ b/frontend/services/destination_recognition/jaeger.go @@ -0,0 +1,46 @@ +package destination_recognition + +import ( + "fmt" + "strings" + + "github.com/odigos-io/odigos/common" + "github.com/odigos-io/odigos/common/config" + k8s "k8s.io/api/core/v1" +) + +type JaegerDestinationFinder struct{} + +const JaegerGrpcOtlpPort int32 = 4317 +const JaegerGrpcUrlFormat = "%s.%s:%d" + +func (j *JaegerDestinationFinder) isPotentialService(service k8s.Service) bool { + for _, port := range service.Spec.Ports { + if isJaegerService(port.Port, service.Name) { + return true + } + } + + return false +} + +func isJaegerService(portNumber int32, name string) bool { + return portNumber == JaegerGrpcOtlpPort && strings.Contains(name, string(common.JaegerDestinationType)) +} + +func (j *JaegerDestinationFinder) fetchDestinationDetails(service k8s.Service) DestinationDetails { + urlString := fmt.Sprintf(JaegerGrpcUrlFormat, service.Name, service.Namespace, JaegerGrpcOtlpPort) + + jaegerServiceURL := j.getServiceURL() + fields := make(map[string]string) + fields[jaegerServiceURL] = urlString + + return DestinationDetails{ + Type: common.JaegerDestinationType, + Fields: fields, + } +} + +func (j *JaegerDestinationFinder) getServiceURL() string { + return config.JaegerUrlKey +} diff --git a/frontend/services/destinations.go b/frontend/services/destinations.go new file mode 100644 index 000000000..79147d89b --- /dev/null +++ b/frontend/services/destinations.go @@ -0,0 +1,300 @@ +package services + +import ( + "context" + "encoding/json" + "fmt" + + "github.com/odigos-io/odigos/api/odigos/v1alpha1" + "github.com/odigos-io/odigos/common" + "github.com/odigos-io/odigos/common/consts" + "github.com/odigos-io/odigos/destinations" + "github.com/odigos-io/odigos/frontend/graph/model" + "github.com/odigos-io/odigos/frontend/kube" + "github.com/odigos-io/odigos/frontend/services/destination_recognition" + "github.com/odigos-io/odigos/k8sutils/pkg/env" + k8s "k8s.io/api/core/v1" + metav1 "k8s.io/apimachinery/pkg/apis/meta/v1" + "k8s.io/apimachinery/pkg/types" +) + +func GetDestinationTypes() model.GetDestinationTypesResponse { + var resp model.GetDestinationTypesResponse + itemsByCategory := make(map[string][]model.DestinationTypesCategoryItem) + for _, destConfig := range destinations.Get() { + item := DestinationTypeConfigToCategoryItem(destConfig) + itemsByCategory[destConfig.Metadata.Category] = append(itemsByCategory[destConfig.Metadata.Category], item) + } + + for category, items := range itemsByCategory { + resp.Categories = append(resp.Categories, model.DestinationsCategory{ + Name: category, + Items: items, + }) + + } + + return resp + +} + +func DestinationTypeConfigToCategoryItem(destConfig destinations.Destination) model.DestinationTypesCategoryItem { + + return model.DestinationTypesCategoryItem{ + Type: string(destConfig.Metadata.Type), + DisplayName: destConfig.Metadata.DisplayName, + ImageUrl: GetImageURL(destConfig.Spec.Image), + TestConnectionSupported: destConfig.Spec.TestConnectionSupported, + SupportedSignals: model.SupportedSignals{ + Traces: model.ObservabilitySignalSupport{ + Supported: destConfig.Spec.Signals.Traces.Supported, + }, + Metrics: model.ObservabilitySignalSupport{ + Supported: destConfig.Spec.Signals.Metrics.Supported, + }, + Logs: model.ObservabilitySignalSupport{ + Supported: destConfig.Spec.Signals.Logs.Supported, + }, + }, + } + +} + +func GetDestinationTypeConfig(destType common.DestinationType) (*destinations.Destination, error) { + for _, dest := range destinations.Get() { + if dest.Metadata.Type == destType { + return &dest, nil + } + } + + return nil, fmt.Errorf("destination type %s not found", destType) +} + +func VerifyDestinationDataScheme(destType common.DestinationType, destTypeConfig *destinations.Destination, data map[string]string) []error { + + errors := []error{} + + // verify all fields in config are present in data (assuming here all fields are required) + for _, field := range destTypeConfig.Spec.Fields { + required, ok := field.ComponentProps["required"].(bool) + if !ok || !required { + continue + } + fieldValue, found := data[field.Name] + if !found || fieldValue == "" { + errors = append(errors, fmt.Errorf("field %s is required", field.Name)) + } + } + + // verify data fields are found in config + for dataField := range data { + found := false + // iterating all fields in config every time, assuming it's a small list + for _, field := range destTypeConfig.Spec.Fields { + if dataField == field.Name { + found = true + break + } + } + if !found { + errors = append(errors, fmt.Errorf("field %s is not found in config for destination type '%s'", dataField, destType)) + } + } + + return errors +} + +func TransformFieldsToDataAndSecrets(destTypeConfig *destinations.Destination, fields map[string]string) (map[string]string, map[string]string) { + + dataFields := map[string]string{} + secretFields := map[string]string{} + + for fieldName, fieldValue := range fields { + + // it is possible that some fields are not required and are empty. + // we should treat them as empty + if fieldValue == "" { + continue + } + + // for each field in the data, find it's config + // assuming the list is small so it's ok to iterate it + for _, fieldConfig := range destTypeConfig.Spec.Fields { + if fieldName == fieldConfig.Name { + if fieldConfig.Secret { + secretFields[fieldName] = fieldValue + } else { + dataFields[fieldName] = fieldValue + } + } + } + } + + return dataFields, secretFields +} + +func GetDestinationSecretFields(c context.Context, odigosns string, dest *v1alpha1.Destination) (map[string]string, error) { + + secretFields := map[string]string{} + secretRef := dest.Spec.SecretRef + + if secretRef == nil { + return secretFields, nil + } + + secret, err := kube.DefaultClient.CoreV1().Secrets(odigosns).Get(c, secretRef.Name, metav1.GetOptions{}) + if err != nil { + return nil, err + } + + for k, v := range secret.Data { + secretFields[k] = string(v) + } + + return secretFields, nil +} + +func K8sDestinationToEndpointFormat(k8sDest v1alpha1.Destination, secretFields map[string]string) model.Destination { + destType := k8sDest.Spec.Type + destName := k8sDest.Spec.DestinationName + mergedFields := mergeDataAndSecrets(k8sDest.Spec.Data, secretFields) + destTypeConfig := DestinationTypeConfigToCategoryItem(destinations.GetDestinationByType(string(destType))) + + fieldsJSON, err := json.Marshal(mergedFields) + if err != nil { + // Handle JSON encoding error + fmt.Printf("Error marshaling fields to JSON: %v\n", err) + fieldsJSON = []byte("{}") // Set to an empty JSON object in case of error + } + + var conditions []metav1.Condition + for _, condition := range k8sDest.Status.Conditions { + conditions = append(conditions, metav1.Condition{ + Type: condition.Type, + Status: condition.Status, + Message: condition.Message, + LastTransitionTime: condition.LastTransitionTime, + }) + } + + return model.Destination{ + Id: k8sDest.Name, + Name: destName, + Type: destType, + ExportedSignals: model.ExportedSignals{ + Traces: isSignalExported(k8sDest, common.TracesObservabilitySignal), + Metrics: isSignalExported(k8sDest, common.MetricsObservabilitySignal), + Logs: isSignalExported(k8sDest, common.LogsObservabilitySignal), + }, + Fields: string(fieldsJSON), + DestinationType: destTypeConfig, + Conditions: conditions, + } +} + +func isSignalExported(dest v1alpha1.Destination, signal common.ObservabilitySignal) bool { + for _, s := range dest.Spec.Signals { + if s == signal { + return true + } + } + + return false +} + +func mergeDataAndSecrets(data map[string]string, secrets map[string]string) map[string]string { + merged := map[string]string{} + + for k, v := range data { + merged[k] = v + } + + for k, v := range secrets { + merged[k] = v + } + + return merged +} +func ExportedSignalsObjectToSlice(signals *model.ExportedSignalsInput) []common.ObservabilitySignal { + var resp []common.ObservabilitySignal + if signals.Traces { + resp = append(resp, common.TracesObservabilitySignal) + } + if signals.Metrics { + resp = append(resp, common.MetricsObservabilitySignal) + } + if signals.Logs { + resp = append(resp, common.LogsObservabilitySignal) + } + + return resp +} + +func CreateDestinationSecret(ctx context.Context, destType common.DestinationType, secretFields map[string]string, odigosns string) (*k8s.LocalObjectReference, error) { + generateNamePrefix := "odigos.io.dest." + string(destType) + "-" + secret := k8s.Secret{ + ObjectMeta: metav1.ObjectMeta{ + GenerateName: generateNamePrefix, + }, + StringData: secretFields, + } + newSecret, err := kube.DefaultClient.CoreV1().Secrets(odigosns).Create(ctx, &secret, metav1.CreateOptions{}) + if err != nil { + return nil, err + } + return &k8s.LocalObjectReference{ + Name: newSecret.Name, + }, nil +} + +func AddDestinationOwnerReferenceToSecret(ctx context.Context, odigosns string, dest *v1alpha1.Destination) error { + destOwnerRef := metav1.OwnerReference{ + APIVersion: "odigos.io/v1alpha1", + Kind: "Destination", + Name: dest.Name, + UID: dest.UID, + } + + secretPatch := []struct { + Op string `json:"op"` + Path string `json:"path"` + Value []metav1.OwnerReference `json:"value"` + }{{ + Op: "add", + Path: "/metadata/ownerReferences", + Value: []metav1.OwnerReference{destOwnerRef}, + }, + } + + secretPatchBytes, err := json.Marshal(secretPatch) + if err != nil { + return err + } + + _, err = kube.DefaultClient.CoreV1().Secrets(odigosns).Patch(ctx, dest.Spec.SecretRef.Name, types.JSONPatchType, secretPatchBytes, metav1.PatchOptions{}) + if err != nil { + return err + } + return nil +} + +func PotentialDestinations(ctx context.Context) []destination_recognition.DestinationDetails { + odigosns := consts.DefaultOdigosNamespace + relevantNamespaces, err := getRelevantNameSpaces(ctx, env.GetCurrentNamespace()) + if err != nil { + return nil + } + + // Existing Destinations + existingDestination, err := kube.DefaultClient.OdigosClient.Destinations(odigosns).List(ctx, metav1.ListOptions{}) + if err != nil { + return nil + } + + destinationDetails, err := destination_recognition.GetAllPotentialDestinationDetails(ctx, relevantNamespaces, existingDestination) + if err != nil { + return nil + } + + return destinationDetails +} diff --git a/frontend/services/namespaces.go b/frontend/services/namespaces.go new file mode 100644 index 000000000..534249c90 --- /dev/null +++ b/frontend/services/namespaces.go @@ -0,0 +1,190 @@ +package services + +import ( + "context" + "fmt" + + "github.com/odigos-io/odigos/common" + "github.com/odigos-io/odigos/k8sutils/pkg/client" + "sigs.k8s.io/yaml" + + "k8s.io/apimachinery/pkg/runtime/schema" + + "golang.org/x/sync/errgroup" + + "github.com/odigos-io/odigos/common/consts" + "github.com/odigos-io/odigos/common/utils" + + "github.com/odigos-io/odigos/frontend/graph/model" + "github.com/odigos-io/odigos/frontend/kube" + v1 "k8s.io/api/core/v1" + metav1 "k8s.io/apimachinery/pkg/apis/meta/v1" +) + +type GetNamespacesResponse struct { + Namespaces []GetNamespaceItem `json:"namespaces"` +} + +type GetNamespaceItem struct { + Name string `json:"name"` + Selected bool `json:"selected"` + TotalApps int `json:"totalApps"` +} + +const ( + OdigosSystemNamespace = "odigos-system" +) + +func GetK8SNamespaces(ctx context.Context) GetNamespacesResponse { + + var ( + relevantNameSpaces []v1.Namespace + appsPerNamespace map[string]int + ) + + g, ctx := errgroup.WithContext(ctx) + g.Go(func() error { + var err error + relevantNameSpaces, err = getRelevantNameSpaces(ctx, OdigosSystemNamespace) + return err + }) + + g.Go(func() error { + var err error + appsPerNamespace, err = CountAppsPerNamespace(ctx) + return err + }) + + if err := g.Wait(); err != nil { + + return GetNamespacesResponse{} + } + + var response GetNamespacesResponse + for _, namespace := range relevantNameSpaces { + // check if entire namespace is instrumented + selected := namespace.Labels[consts.OdigosInstrumentationLabel] == consts.InstrumentationEnabled + + response.Namespaces = append(response.Namespaces, GetNamespaceItem{ + Name: namespace.Name, + Selected: selected, + TotalApps: appsPerNamespace[namespace.Name], + }) + } + + return response +} + +// getRelevantNameSpaces returns a list of namespaces that are relevant for instrumentation. +// Taking into account the ignored namespaces from the OdigosConfiguration. +func getRelevantNameSpaces(ctx context.Context, odigosns string) ([]v1.Namespace, error) { + var ( + odigosConfig *common.OdigosConfiguration + list *v1.NamespaceList + ) + + g, ctx := errgroup.WithContext(ctx) + g.Go(func() error { + var err error + configMap, err := kube.DefaultClient.CoreV1().ConfigMaps(odigosns).Get(ctx, consts.OdigosConfigurationName, metav1.GetOptions{}) + if err != nil { + return err + } + if err := yaml.Unmarshal([]byte(configMap.Data[consts.OdigosConfigurationFileName]), &odigosConfig); err != nil { + return err + } + return err + }) + + g.Go(func() error { + var err error + list, err = kube.DefaultClient.CoreV1().Namespaces().List(ctx, metav1.ListOptions{}) + return err + }) + + if err := g.Wait(); err != nil { + return []v1.Namespace{}, err + } + + result := []v1.Namespace{} + for _, namespace := range list.Items { + if utils.IsItemIgnored(namespace.Name, odigosConfig.IgnoredNamespaces) { + continue + } + + result = append(result, namespace) + } + + return result, nil +} + +type PersistNamespaceItem struct { + Name string `json:"name"` + SelectedAll bool `json:"selected_all"` + FutureSelected *bool `json:"future_selected,omitempty"` + Objects []PersistNamespaceObject `json:"objects"` +} + +type PersistNamespaceObject struct { + Name string `json:"name"` + Kind WorkloadKind `json:"kind"` + Selected *bool `json:"selected,omitempty"` +} + +// returns a map, where the key is a namespace name and the value is the +// number of apps in this namespace (not necessarily instrumented) +func CountAppsPerNamespace(ctx context.Context) (map[string]int, error) { + namespaceToAppsCount := make(map[string]int) + + resourceTypes := []string{"deployments", "statefulsets", "daemonsets"} + + for _, resourceType := range resourceTypes { + err := client.ListWithPages(client.DefaultPageSize, kube.DefaultClient.MetadataClient.Resource(schema.GroupVersionResource{ + Group: "apps", + Version: "v1", + Resource: resourceType, + }).List, ctx, metav1.ListOptions{}, func(list *metav1.PartialObjectMetadataList) error { + for _, item := range list.Items { + namespaceToAppsCount[item.Namespace]++ + } + return nil + }) + + if err != nil { + return nil, fmt.Errorf("failed to count %s: %w", resourceType, err) + } + } + + return namespaceToAppsCount, nil +} + +func GetJsonMergePatchForInstrumentationLabel(enabled *bool) []byte { + labelJsonMergePatchValue := "null" + if enabled != nil { + if *enabled { + labelJsonMergePatchValue = fmt.Sprintf("\"%s\"", consts.InstrumentationEnabled) + } else { + labelJsonMergePatchValue = fmt.Sprintf("\"%s\"", consts.InstrumentationDisabled) + } + } + + jsonMergePatchContent := fmt.Sprintf(`{"metadata":{"labels":{"%s":%s}}}`, consts.OdigosInstrumentationLabel, labelJsonMergePatchValue) + return []byte(jsonMergePatchContent) +} + +func SyncWorkloadsInNamespace(ctx context.Context, nsName string, workloads []model.PersistNamespaceSourceInput) error { + g, ctx := errgroup.WithContext(ctx) + g.SetLimit(kube.K8sClientDefaultBurst) + + for _, workload := range workloads { + currWorkload := workload + g.Go(func() error { + // Only label selected sources, ignore the rest + if currWorkload.Selected != nil { + return setWorkloadInstrumentationLabel(ctx, nsName, currWorkload.Name, WorkloadKind(currWorkload.Kind.String()), currWorkload.Selected) + } + return nil + }) + } + return g.Wait() +} diff --git a/frontend/services/sources.go b/frontend/services/sources.go new file mode 100644 index 000000000..2a9d0992f --- /dev/null +++ b/frontend/services/sources.go @@ -0,0 +1,382 @@ +package services + +import ( + "context" + "fmt" + "time" + + "github.com/odigos-io/odigos/api/odigos/v1alpha1" + "github.com/odigos-io/odigos/common/consts" + "github.com/odigos-io/odigos/frontend/kube" + + "github.com/odigos-io/odigos/k8sutils/pkg/workload" + metav1 "k8s.io/apimachinery/pkg/apis/meta/v1" + + appsv1 "k8s.io/api/apps/v1" + + "github.com/odigos-io/odigos/frontend/graph/model" + + "github.com/odigos-io/odigos/k8sutils/pkg/client" + + "golang.org/x/sync/errgroup" + corev1 "k8s.io/api/core/v1" +) + +type WorkloadKind string + +const ( + WorkloadKindDeployment WorkloadKind = "Deployment" + WorkloadKindStatefulSet WorkloadKind = "StatefulSet" + WorkloadKindDaemonSet WorkloadKind = "DaemonSet" +) + +type SourceLanguage struct { + ContainerName string `json:"container_name"` + Language string `json:"language"` +} + +type InstrumentedApplicationDetails struct { + Languages []SourceLanguage `json:"languages,omitempty"` + Conditions []metav1.Condition `json:"conditions,omitempty"` +} +type SourceID struct { + // combination of namespace, kind and name is unique + Name string `json:"name"` + Kind string `json:"kind"` + Namespace string `json:"namespace"` +} + +type Source struct { + ThinSource + ReportedName string `json:"reported_name,omitempty"` +} + +type PatchSourceRequest struct { + ReportedName *string `json:"reported_name"` +} + +// this object contains only part of the source fields. It is used to display the sources in the frontend +type ThinSource struct { + SourceID + NumberOfRunningInstances int `json:"number_of_running_instances"` + IaDetails *InstrumentedApplicationDetails `json:"instrumented_application_details"` +} + +func GetActualSource(ctx context.Context, ns string, kind string, name string) (*Source, error) { + k8sObjectName := workload.CalculateWorkloadRuntimeObjectName(name, kind) + owner, numberOfRunningInstances := GetWorkload(ctx, ns, kind, name) + if owner == nil { + return nil, fmt.Errorf("owner not found") + } + ownerAnnotations := owner.GetAnnotations() + var reportedName string + if ownerAnnotations != nil { + reportedName = ownerAnnotations[consts.OdigosReportedNameAnnotation] + } + + ts := ThinSource{ + SourceID: SourceID{ + Namespace: ns, + Kind: kind, + Name: name, + }, + NumberOfRunningInstances: numberOfRunningInstances, + } + + instrumentedApplication, err := kube.DefaultClient.OdigosClient.InstrumentedApplications(ns).Get(ctx, k8sObjectName, metav1.GetOptions{}) + if err == nil { + ts.IaDetails = k8sInstrumentedAppToThinSource(instrumentedApplication).IaDetails + err = addHealthyInstrumentationInstancesCondition(ctx, instrumentedApplication, &ts) + if err != nil { + return nil, err + } + } + + return &Source{ + ThinSource: ts, + ReportedName: reportedName, + }, nil +} + +func GetWorkload(c context.Context, ns string, kind string, name string) (metav1.Object, int) { + switch kind { + case "Deployment": + deployment, err := kube.DefaultClient.AppsV1().Deployments(ns).Get(c, name, metav1.GetOptions{}) + if err != nil { + return nil, 0 + } + return deployment, int(deployment.Status.AvailableReplicas) + case "StatefulSet": + statefulSet, err := kube.DefaultClient.AppsV1().StatefulSets(ns).Get(c, name, metav1.GetOptions{}) + if err != nil { + return nil, 0 + } + return statefulSet, int(statefulSet.Status.ReadyReplicas) + case "DaemonSet": + daemonSet, err := kube.DefaultClient.AppsV1().DaemonSets(ns).Get(c, name, metav1.GetOptions{}) + if err != nil { + return nil, 0 + } + return daemonSet, int(daemonSet.Status.NumberReady) + default: + return nil, 0 + } +} + +func addHealthyInstrumentationInstancesCondition(ctx context.Context, app *v1alpha1.InstrumentedApplication, source *ThinSource) error { + labelSelector := fmt.Sprintf("%s=%s", consts.InstrumentedAppNameLabel, app.Name) + instancesList, err := kube.DefaultClient.OdigosClient.InstrumentationInstances(app.Namespace).List(ctx, metav1.ListOptions{ + LabelSelector: labelSelector, + }) + + if err != nil { + return err + } + + totalInstances := len(instancesList.Items) + if totalInstances == 0 { + // no instances so nothing to report + return nil + } + + healthyInstances := 0 + latestStatusTime := metav1.NewTime(time.Time{}) + for _, instance := range instancesList.Items { + if instance.Status.Healthy != nil && *instance.Status.Healthy { + healthyInstances++ + } + if instance.Status.LastStatusTime.After(latestStatusTime.Time) { + latestStatusTime = instance.Status.LastStatusTime + } + } + + status := metav1.ConditionTrue + if healthyInstances < totalInstances { + status = metav1.ConditionFalse + } + + source.IaDetails.Conditions = append(source.IaDetails.Conditions, metav1.Condition{ + Type: "HealthyInstrumentationInstances", + Status: status, + LastTransitionTime: latestStatusTime, + Message: fmt.Sprintf("%d/%d instances are healthy", healthyInstances, totalInstances), + }) + + return nil +} + +func k8sInstrumentedAppToThinSource(app *v1alpha1.InstrumentedApplication) ThinSource { + var source ThinSource + source.Name = app.OwnerReferences[0].Name + source.Kind = app.OwnerReferences[0].Kind + source.Namespace = app.Namespace + var conditions []metav1.Condition + for _, condition := range app.Status.Conditions { + conditions = append(conditions, metav1.Condition{ + Type: condition.Type, + Status: condition.Status, + Message: condition.Message, + LastTransitionTime: condition.LastTransitionTime, + }) + } + source.IaDetails = &InstrumentedApplicationDetails{ + Languages: []SourceLanguage{}, + Conditions: conditions, + } + for _, language := range app.Spec.RuntimeDetails { + source.IaDetails.Languages = append(source.IaDetails.Languages, SourceLanguage{ + ContainerName: language.ContainerName, + Language: string(language.Language), + }) + } + return source +} + +func GetWorkloadsInNamespace(ctx context.Context, nsName string, instrumentationLabeled *bool) ([]model.K8sActualSource, error) { + + namespace, err := kube.DefaultClient.CoreV1().Namespaces().Get(ctx, nsName, metav1.GetOptions{}) + if err != nil { + return nil, err + } + + g, ctx := errgroup.WithContext(ctx) + var ( + deps []model.K8sActualSource + ss []model.K8sActualSource + dss []model.K8sActualSource + ) + + g.Go(func() error { + var err error + deps, err = getDeployments(ctx, *namespace, instrumentationLabeled) + return err + }) + + g.Go(func() error { + var err error + ss, err = getStatefulSets(ctx, *namespace, instrumentationLabeled) + return err + }) + + g.Go(func() error { + var err error + dss, err = getDaemonSets(ctx, *namespace, instrumentationLabeled) + return err + }) + + if err := g.Wait(); err != nil { + return nil, err + } + + items := make([]model.K8sActualSource, len(deps)+len(ss)+len(dss)) + copy(items, deps) + copy(items[len(deps):], ss) + copy(items[len(deps)+len(ss):], dss) + + return items, nil +} + +func getDeployments(ctx context.Context, namespace corev1.Namespace, instrumentationLabeled *bool) ([]model.K8sActualSource, error) { + var response []model.K8sActualSource + err := client.ListWithPages(client.DefaultPageSize, kube.DefaultClient.AppsV1().Deployments(namespace.Name).List, ctx, metav1.ListOptions{}, func(deps *appsv1.DeploymentList) error { + for _, dep := range deps.Items { + _, _, decisionText, autoInstrumented := workload.GetInstrumentationLabelTexts(dep.GetLabels(), string(WorkloadKindDeployment), namespace.GetLabels()) + if instrumentationLabeled != nil && *instrumentationLabeled != autoInstrumented { + continue + } + numberOfInstances := int(dep.Status.ReadyReplicas) + response = append(response, model.K8sActualSource{ + Namespace: dep.Namespace, + Name: dep.Name, + Kind: k8sKindToGql(string(WorkloadKindDeployment)), + NumberOfInstances: &numberOfInstances, + AutoInstrumented: autoInstrumented, + AutoInstrumentedDecision: decisionText, + InstrumentedApplicationDetails: nil, // TODO: fill this + }) + } + return nil + }) + + if err != nil { + return nil, err + } + + return response, nil +} + +func getDaemonSets(ctx context.Context, namespace corev1.Namespace, instrumentationLabeled *bool) ([]model.K8sActualSource, error) { + var response []model.K8sActualSource + err := client.ListWithPages(client.DefaultPageSize, kube.DefaultClient.AppsV1().DaemonSets(namespace.Name).List, ctx, metav1.ListOptions{}, func(dss *appsv1.DaemonSetList) error { + for _, ds := range dss.Items { + _, _, decisionText, autoInstrumented := workload.GetInstrumentationLabelTexts(ds.GetLabels(), string(WorkloadKindDaemonSet), namespace.GetLabels()) + if instrumentationLabeled != nil && *instrumentationLabeled != autoInstrumented { + continue + } + numberOfInstances := int(ds.Status.NumberReady) + response = append(response, model.K8sActualSource{ + Namespace: ds.Namespace, + Name: ds.Name, + Kind: k8sKindToGql(string(WorkloadKindDaemonSet)), + NumberOfInstances: &numberOfInstances, + AutoInstrumented: autoInstrumented, + AutoInstrumentedDecision: decisionText, + InstrumentedApplicationDetails: nil, // TODO: fill this + }) + } + return nil + }) + + if err != nil { + return nil, err + } + + return response, nil +} + +func getStatefulSets(ctx context.Context, namespace corev1.Namespace, instrumentationLabeled *bool) ([]model.K8sActualSource, error) { + var response []model.K8sActualSource + err := client.ListWithPages(client.DefaultPageSize, kube.DefaultClient.AppsV1().StatefulSets(namespace.Name).List, ctx, metav1.ListOptions{}, func(sss *appsv1.StatefulSetList) error { + for _, ss := range sss.Items { + _, _, decisionText, autoInstrumented := workload.GetInstrumentationLabelTexts(ss.GetLabels(), string(WorkloadKindStatefulSet), namespace.GetLabels()) + if instrumentationLabeled != nil && *instrumentationLabeled != autoInstrumented { + continue + } + numberOfInstances := int(ss.Status.ReadyReplicas) + response = append(response, model.K8sActualSource{ + Namespace: ss.Namespace, + Name: ss.Name, + Kind: k8sKindToGql(string(WorkloadKindStatefulSet)), + NumberOfInstances: &numberOfInstances, + AutoInstrumented: autoInstrumented, + AutoInstrumentedDecision: decisionText, + InstrumentedApplicationDetails: nil, // TODO: fill this + }) + } + return nil + }) + + if err != nil { + return nil, err + } + + return response, nil +} + +func k8sKindToGql(k8sResourceKind string) model.K8sResourceKind { + switch k8sResourceKind { + case "Deployment": + return model.K8sResourceKindDeployment + case "StatefulSet": + return model.K8sResourceKindStatefulSet + case "DaemonSet": + return model.K8sResourceKindDaemonSet + } + return "" +} + +func UpdateReportedName( + ctx context.Context, + ns, kind, name, reportedName string, +) error { + switch kind { + case "Deployment": + deployment, err := kube.DefaultClient.AppsV1().Deployments(ns).Get(ctx, name, metav1.GetOptions{}) + if err != nil { + return fmt.Errorf("could not find deployment: %w", err) + } + deployment.SetAnnotations(updateAnnotations(deployment.GetAnnotations(), reportedName)) + _, err = kube.DefaultClient.AppsV1().Deployments(ns).Update(ctx, deployment, metav1.UpdateOptions{}) + return err + case "StatefulSet": + statefulSet, err := kube.DefaultClient.AppsV1().StatefulSets(ns).Get(ctx, name, metav1.GetOptions{}) + if err != nil { + return fmt.Errorf("could not find statefulset: %w", err) + } + statefulSet.SetAnnotations(updateAnnotations(statefulSet.GetAnnotations(), reportedName)) + _, err = kube.DefaultClient.AppsV1().StatefulSets(ns).Update(ctx, statefulSet, metav1.UpdateOptions{}) + return err + case "DaemonSet": + daemonSet, err := kube.DefaultClient.AppsV1().DaemonSets(ns).Get(ctx, name, metav1.GetOptions{}) + if err != nil { + return fmt.Errorf("could not find daemonset: %w", err) + } + daemonSet.SetAnnotations(updateAnnotations(daemonSet.GetAnnotations(), reportedName)) + _, err = kube.DefaultClient.AppsV1().DaemonSets(ns).Update(ctx, daemonSet, metav1.UpdateOptions{}) + return err + default: + return fmt.Errorf("unsupported kind: %s", kind) + } +} + +func updateAnnotations(annotations map[string]string, reportedName string) map[string]string { + if annotations == nil { + annotations = make(map[string]string) + } + if reportedName == "" { + delete(annotations, consts.OdigosReportedNameAnnotation) + } else { + annotations[consts.OdigosReportedNameAnnotation] = reportedName + } + return annotations +} diff --git a/frontend/services/test_connection/conversion.go b/frontend/services/test_connection/conversion.go new file mode 100644 index 000000000..aa26d882b --- /dev/null +++ b/frontend/services/test_connection/conversion.go @@ -0,0 +1,58 @@ +package testconnection + +import ( + "errors" + + "github.com/odigos-io/odigos/common" + "github.com/odigos-io/odigos/common/config" + "github.com/odigos-io/odigos/frontend/graph/model" +) + +// Implement the ExporterConfigurer interface +type DestinationConfigurer struct { + destination model.DestinationInput +} + +func (dc *DestinationConfigurer) GetSignals() []common.ObservabilitySignal { + var signals []common.ObservabilitySignal + if dc.destination.ExportedSignals.Traces { + signals = append(signals, common.TracesObservabilitySignal) + } + if dc.destination.ExportedSignals.Metrics { + signals = append(signals, common.MetricsObservabilitySignal) + } + if dc.destination.ExportedSignals.Logs { + signals = append(signals, common.LogsObservabilitySignal) + } + return signals +} + +func (dc *DestinationConfigurer) GetType() common.DestinationType { + // Convert the string type to common.DestinationType + return common.DestinationType(dc.destination.Type) +} + +func (dc *DestinationConfigurer) GetID() string { + // Generate a unique ID for the Exporter, you can base this on the destination name or type + return dc.destination.Name +} + +func (dc *DestinationConfigurer) GetConfig() map[string]string { + configMap := make(map[string]string) + for _, field := range dc.destination.Fields { + configMap[field.Key] = field.Value + } + return configMap +} + +func ConvertDestinationToConfigurer(destination model.DestinationInput) (config.ExporterConfigurer, error) { + + if destination.Type == "" { + return nil, errors.New("destination type is required") + } + + // Additional validation or conversion logic can be added here if needed + + // Return a new instance of DestinationConfigurer which implements ExporterConfigurer + return &DestinationConfigurer{destination: destination}, nil +} diff --git a/frontend/services/test_connection/otlp_test_connection.go b/frontend/services/test_connection/otlp_test_connection.go new file mode 100644 index 000000000..6a137e31b --- /dev/null +++ b/frontend/services/test_connection/otlp_test_connection.go @@ -0,0 +1,37 @@ +package testconnection + +import ( + "go.opentelemetry.io/collector/component" + "go.opentelemetry.io/collector/exporter" + + "go.opentelemetry.io/collector/exporter/otlpexporter" +) + +var _ ExporterConnectionTester = &otlpExporterConnectionTester{} + +type otlpExporterConnectionTester struct { + f exporter.Factory +} + +func NewOTLPTester() *otlpExporterConnectionTester { + return &otlpExporterConnectionTester{ + f: otlpexporter.NewFactory(), + } +} + +func (t *otlpExporterConnectionTester) Factory() exporter.Factory { + return t.f +} + +func (t *otlpExporterConnectionTester) ModifyConfigForConnectionTest(cfg component.Config) component.Config { + otlpConf, ok := cfg.(*otlpexporter.Config) + if !ok { + return nil + } + + // currently using the default timeout config of the collector - 5 seconds + // Avoid batching and retries + otlpConf.QueueConfig.Enabled = false + otlpConf.RetryConfig.Enabled = false + return otlpConf +} diff --git a/frontend/services/test_connection/otlphttp_test_connection.go b/frontend/services/test_connection/otlphttp_test_connection.go new file mode 100644 index 000000000..42c12c166 --- /dev/null +++ b/frontend/services/test_connection/otlphttp_test_connection.go @@ -0,0 +1,36 @@ +package testconnection + +import ( + "go.opentelemetry.io/collector/component" + "go.opentelemetry.io/collector/exporter" + "go.opentelemetry.io/collector/exporter/otlphttpexporter" +) + +var _ ExporterConnectionTester = &otlphttpExporterConnectionTester{} + +type otlphttpExporterConnectionTester struct { + f exporter.Factory +} + +func NewOTLPHTTPTester() *otlphttpExporterConnectionTester { + return &otlphttpExporterConnectionTester{ + f: otlphttpexporter.NewFactory(), + } +} + +func (t *otlphttpExporterConnectionTester) Factory() exporter.Factory { + return t.f +} + +func (t *otlphttpExporterConnectionTester) ModifyConfigForConnectionTest(cfg component.Config) component.Config { + otlpConf, ok := cfg.(*otlphttpexporter.Config) + if !ok { + return nil + } + + // currently using the default timeout config of the collector - 5 seconds + // Avoid batching and retries + otlpConf.QueueConfig.Enabled = false + otlpConf.RetryConfig.Enabled = false + return otlpConf +} diff --git a/frontend/services/test_connection/test_connection.go b/frontend/services/test_connection/test_connection.go new file mode 100644 index 000000000..6c078f29a --- /dev/null +++ b/frontend/services/test_connection/test_connection.go @@ -0,0 +1,157 @@ +package testconnection + +import ( + "context" + "fmt" + "net/http" + "strings" + + "github.com/odigos-io/odigos/common" + "github.com/odigos-io/odigos/common/config" + + "go.opentelemetry.io/collector/component" + "go.opentelemetry.io/collector/confmap" + "go.opentelemetry.io/collector/exporter" + "go.opentelemetry.io/collector/exporter/exportertest" + "go.opentelemetry.io/collector/pdata/ptrace" +) + +var ( + configres map[common.DestinationType]config.Configer + connectionTesters = []ExporterConnectionTester{ + NewOTLPTester(), // "otlp/" prefix + NewOTLPHTTPTester(), // "otlphttp/" prefix + } +) + +func init() { + var err error + configres, err = config.LoadConfigers() + if err != nil { + panic(1) + } +} + +type TestConnectionErrorReason string + +const ( + UnKnownDestination TestConnectionErrorReason = "unknown destination" + InvalidConfig TestConnectionErrorReason = "invalid config" + UnsupportedExporterType TestConnectionErrorReason = "unsupported exporter type" + FailedToConnect TestConnectionErrorReason = "failed to connect" +) + +type TestConnectionResult struct { + Succeeded bool + Message string + Reason TestConnectionErrorReason + StatusCode int + DestinationType common.DestinationType +} + +type ExporterConnectionTester interface { + // Factory returns the exporter factory for the exporter type. + // This is used to create the exporter instance for testing the connection. + Factory() exporter.Factory + // ModifyConfigForConnectionTest modifies the exporter configuration for testing the connection. + // Since the default configuration may have batching, retries, etc. which may not be suitable for testing the connection. + ModifyConfigForConnectionTest(component.Config) component.Config +} + +func getConnectionTester(exporterID string) ExporterConnectionTester { + for _, tester := range connectionTesters { + prefix := fmt.Sprintf("%s/", tester.Factory().Type().String()) + if strings.HasPrefix(exporterID, prefix) { + return tester + } + } + return nil +} + +func TestConnection(ctx context.Context, dest config.ExporterConfigurer) TestConnectionResult { + destType := dest.GetType() + configer, ok := configres[destType] + if !ok { + return TestConnectionResult{Succeeded: false, Reason: UnKnownDestination, DestinationType: destType, StatusCode: http.StatusNotImplemented} + } + + currentConfig := config.Config{ + Exporters: make(config.GenericMap), + Service: config.Service{ + Pipelines: make(map[string]config.Pipeline), + }, + } + err := configer.ModifyConfig(dest, ¤tConfig) + if err != nil { + return TestConnectionResult{Succeeded: false, Message: err.Error(), Reason: InvalidConfig, DestinationType: destType, StatusCode: http.StatusInternalServerError} + } + + exporters := currentConfig.Exporters + if len(exporters) == 0 { + return TestConnectionResult{Message: "no exporters found in config", Reason: InvalidConfig, DestinationType: destType, StatusCode: http.StatusInternalServerError, Succeeded: false} + } + + var exporterRawConfig config.GenericMap + var connectionTester ExporterConnectionTester + foundTester := false + for componentID, cfg := range exporters { + gm, ok := cfg.(config.GenericMap) + if !ok { + continue + } + ct := getConnectionTester(componentID) + if ct != nil { + connectionTester = ct + foundTester = true + exporterRawConfig = gm + break + } + } + + if !foundTester { + return TestConnectionResult{Succeeded: false, Message: "no supported exporter found in config", Reason: UnsupportedExporterType, DestinationType: destType, StatusCode: http.StatusNotFound} + } + + // before testing the connection, replace placeholders (if exists) in the config with actual values + replacePlaceholders(exporterRawConfig, dest.GetConfig()) + defaultConfig := connectionTester.Factory().CreateDefaultConfig() + connectionTester.ModifyConfigForConnectionTest(defaultConfig) + + // convert the user provided fields to a collector config + exportersConf := confmap.NewFromStringMap(exporterRawConfig) + if exportersConf == nil { + return TestConnectionResult{Succeeded: false, Message: "failed to create exporter config", Reason: InvalidConfig, DestinationType: destType, StatusCode: http.StatusInternalServerError} + } + + // unmarshal the user provided configuration into the default one, merging them + err = exportersConf.Unmarshal(&defaultConfig) + if err != nil { + return TestConnectionResult{Succeeded: false, Message: err.Error(), Reason: InvalidConfig, DestinationType: destType, StatusCode: http.StatusInternalServerError} + } + + if validator, ok := defaultConfig.(component.ConfigValidator); ok { + // if the component has a Validate method, call it to validate the configuration + err = validator.Validate() + if err != nil { + return TestConnectionResult{Succeeded: false, Message: err.Error(), Reason: InvalidConfig, DestinationType: destType, StatusCode: http.StatusInternalServerError} + } + } + + exporter, err := connectionTester.Factory().CreateTracesExporter(ctx, exportertest.NewNopSettings(), defaultConfig) + if err != nil { + return TestConnectionResult{Succeeded: false, Message: err.Error(), Reason: InvalidConfig, DestinationType: destType, StatusCode: http.StatusInternalServerError} + } + + err = exporter.Start(ctx, nil) + if err != nil { + return TestConnectionResult{Succeeded: false, Message: err.Error(), Reason: FailedToConnect, DestinationType: destType, StatusCode: http.StatusInternalServerError} + } + + defer exporter.Shutdown(ctx) + err = exporter.ConsumeTraces(ctx, ptrace.NewTraces()) + if err != nil { + return TestConnectionResult{Succeeded: false, Message: err.Error(), Reason: FailedToConnect, DestinationType: destType, StatusCode: http.StatusInternalServerError} + } + + return TestConnectionResult{Succeeded: true, DestinationType: destType, StatusCode: http.StatusOK} +} diff --git a/frontend/services/test_connection/utils.go b/frontend/services/test_connection/utils.go new file mode 100644 index 000000000..aca670899 --- /dev/null +++ b/frontend/services/test_connection/utils.go @@ -0,0 +1,43 @@ +package testconnection + +import ( + "regexp" + "strings" + + "github.com/odigos-io/odigos/common/config" +) + +// replacePlaceholders replaces placeholder values in the given GenericMap with values from the fields map. +// It traverses the GenericMap recursively and processes each string value as a template. +// If a string value contains placeholders in the format {KEY}, it replaces them with corresponding values from the fields map. +// The function supports nested GenericMaps and map[string]interface{} structures. +func replacePlaceholders(gmap config.GenericMap, fields map[string]string) { + // Regular expression to match the ${KEY} pattern + re := regexp.MustCompile(`\$\{([^}]+)\}`) + + for key, value := range gmap { + switch v := value.(type) { + case string: + // Find all matches of the pattern ${KEY} + matches := re.FindAllStringSubmatch(v, -1) + for _, match := range matches { + if len(match) == 2 { + // match[0] is the entire match (${KEY}), match[1] is the key (KEY) + extractedKey := match[1] + if replacement, ok := fields[extractedKey]; ok { + // Replace only the ${KEY} part in the original string + v = strings.Replace(v, match[0], replacement, -1) + // Update the map with the new value + gmap[key] = v + } + } + } + case config.GenericMap: + replacePlaceholders(v, fields) + case map[string]interface{}: + replacePlaceholders(v, fields) + default: + // If the value is not a string or a map, we leave it as it is + } + } +} \ No newline at end of file diff --git a/frontend/services/test_connection/utils_test.go b/frontend/services/test_connection/utils_test.go new file mode 100644 index 000000000..48787fc9c --- /dev/null +++ b/frontend/services/test_connection/utils_test.go @@ -0,0 +1,56 @@ +package testconnection + +import ( + "testing" + + "github.com/odigos-io/odigos/common/config" + "github.com/stretchr/testify/assert" +) + +func TestReplacePlaceholders(t *testing.T) { + // Fields map with replacements + fields := map[string]string{ + "MY_KEY1": "MY_VALUE1", + "MY_KEY2": "MY_VALUE2", + } + + gmap := config.GenericMap{ + "key1": "${MY_KEY1}", + "key2": 123, + "key3": config.GenericMap{ + "nestedKey1": "${MY_KEY2}", // replaced with MY_VALUE2 + "nestedKey2": "someValue", // no replacement + "nestedKey3": "${MY_KEY3}", // no replacement + "nestedKey4": "some prefix: ${MY_KEY2}", // replaced with "some prefix: MY_VALUE2" + }, + } + + replacePlaceholders(gmap, fields) + assert.Equal(t, "MY_VALUE1", gmap["key1"]) + assert.Equal(t, config.GenericMap{ + "nestedKey1": "MY_VALUE2", + "nestedKey2": "someValue", + "nestedKey3": "${MY_KEY3}", + "nestedKey4": "some prefix: MY_VALUE2", + }, gmap["key3"]) + assert.Equal(t, 123, gmap["key2"]) + + // don't change the original map if no placeholders are found + gmap = config.GenericMap{ + "key1": "value1", + "key2": 123, + "key3": config.GenericMap{ + "nestedKey1": "value2", + "nestedKey2": "someValue", + }, + } + + replacePlaceholders(gmap, fields) + assert.Equal(t, "value1", gmap["key1"]) + assert.Equal(t, config.GenericMap{ + "nestedKey1": "value2", + "nestedKey2": "someValue", + }, gmap["key3"]) + assert.Equal(t, 123, gmap["key2"]) + +} \ No newline at end of file diff --git a/frontend/services/utils.go b/frontend/services/utils.go new file mode 100644 index 000000000..a85f6b8f3 --- /dev/null +++ b/frontend/services/utils.go @@ -0,0 +1,50 @@ +package services + +import ( + "context" + "errors" + "fmt" + "path" + "strings" + + "github.com/odigos-io/odigos/frontend/kube" + metav1 "k8s.io/apimachinery/pkg/apis/meta/v1" + "k8s.io/apimachinery/pkg/types" +) + +const cdnUrl = "https://d15jtxgb40qetw.cloudfront.net" + +func GetImageURL(image string) string { + return path.Join(cdnUrl, image) +} + +func setWorkloadInstrumentationLabel(ctx context.Context, nsName string, workloadName string, workloadKind WorkloadKind, enabled *bool) error { + jsonMergePatchData := GetJsonMergePatchForInstrumentationLabel(enabled) + + switch workloadKind { + case WorkloadKindDeployment: + _, err := kube.DefaultClient.AppsV1().Deployments(nsName).Patch(ctx, workloadName, types.MergePatchType, jsonMergePatchData, metav1.PatchOptions{}) + return err + case WorkloadKindStatefulSet: + _, err := kube.DefaultClient.AppsV1().StatefulSets(nsName).Patch(ctx, workloadName, types.MergePatchType, jsonMergePatchData, metav1.PatchOptions{}) + return err + case WorkloadKindDaemonSet: + _, err := kube.DefaultClient.AppsV1().DaemonSets(nsName).Patch(ctx, workloadName, types.MergePatchType, jsonMergePatchData, metav1.PatchOptions{}) + return err + default: + return errors.New("unsupported workload kind " + string(workloadKind)) + } +} + +func ConvertFieldsToString(fields map[string]string) string { + if len(fields) == 0 { + return "" + } + + var parts []string + for key, value := range fields { + parts = append(parts, fmt.Sprintf("%s: %s", key, value)) + } + + return strings.Join(parts, ", ") +} diff --git a/frontend/webapp/app/(setup)/choose-destination/page.tsx b/frontend/webapp/app/(setup)/choose-destination/page.tsx index 66b0badb5..07187db2a 100644 --- a/frontend/webapp/app/(setup)/choose-destination/page.tsx +++ b/frontend/webapp/app/(setup)/choose-destination/page.tsx @@ -1,18 +1,16 @@ 'use client'; import React from 'react'; -import { StepsList } from '@/components'; -import { ChooseDestinationContainer } from '@/containers'; -import { CardWrapper, PageContainer, StepListWrapper } from '../styled'; +import { SideMenu } from '@/components'; +import { SideMenuWrapper } from '../styled'; +import { ChooseDestinationContainer } from '@/containers/main'; export default function ChooseDestinationPage() { return ( - - - - - - - - + <> + + + + + ); } diff --git a/frontend/webapp/app/(setup)/choose-sources/page.tsx b/frontend/webapp/app/(setup)/choose-sources/page.tsx index 495ec2f21..a612ab2ae 100644 --- a/frontend/webapp/app/(setup)/choose-sources/page.tsx +++ b/frontend/webapp/app/(setup)/choose-sources/page.tsx @@ -1,18 +1,16 @@ 'use client'; import React from 'react'; -import { StepsList } from '@/components'; -import { ChooseSourcesContainer } from '@/containers'; -import { CardWrapper, PageContainer, StepListWrapper } from '../styled'; +import { SideMenu } from '@/components'; +import { ChooseSourcesContainer } from '@/containers/main'; +import { SideMenuWrapper } from '../styled'; export default function ChooseSourcesPage() { return ( - - - - - - - - + <> + + + + + ); } diff --git a/frontend/webapp/app/(setup)/connect-destination/page.tsx b/frontend/webapp/app/(setup)/connect-destination/page.tsx deleted file mode 100644 index 5217c328c..000000000 --- a/frontend/webapp/app/(setup)/connect-destination/page.tsx +++ /dev/null @@ -1,17 +0,0 @@ -'use client'; -import { StepsList } from '@/components'; -import { ConnectDestinationContainer } from '@/containers'; -import { CardWrapper, PageContainer, StepListWrapper } from '../styled'; - -export default function ConnectDestinationPage() { - return ( - - - - - - - - - ); -} diff --git a/frontend/webapp/app/(setup)/layout.tsx b/frontend/webapp/app/(setup)/layout.tsx index d93a42f6f..6e7cab11e 100644 --- a/frontend/webapp/app/(setup)/layout.tsx +++ b/frontend/webapp/app/(setup)/layout.tsx @@ -1,7 +1,23 @@ 'use client'; import React from 'react'; -import Logo from '@/assets/logos/odigos-gradient.svg'; -import { LogoWrapper, SetupPageContainer } from './styled'; +import styled from 'styled-components'; + +const LayoutContainer = styled.div` + width: 100%; + height: 100vh; + background-color: ${({ theme }) => theme.colors.primary}; + display: flex; + align-items: center; + flex-direction: column; +`; + +const MainContent = styled.div` + display: flex; + max-width: 1440px; + width: 100vh; + flex-direction: column; + align-items: center; +`; export default function SetupLayout({ children, @@ -9,11 +25,8 @@ export default function SetupLayout({ children: React.ReactNode; }) { return ( - - - - - {children} - + + {children} + ); } diff --git a/frontend/webapp/app/(setup)/styled.ts b/frontend/webapp/app/(setup)/styled.ts new file mode 100644 index 000000000..a4d810aa6 --- /dev/null +++ b/frontend/webapp/app/(setup)/styled.ts @@ -0,0 +1,11 @@ +import styled from 'styled-components'; + +export const SideMenuWrapper = styled.div` + position: absolute; + left: 24px; + top: 144px; + + @media (max-width: 1050px) { + display: none; + } +`; diff --git a/frontend/webapp/app/(setup)/styled.tsx b/frontend/webapp/app/(setup)/styled.tsx deleted file mode 100644 index 4e3e49040..000000000 --- a/frontend/webapp/app/(setup)/styled.tsx +++ /dev/null @@ -1,41 +0,0 @@ -import styled from 'styled-components'; - -export const SetupPageContainer = styled.div` - width: 100vw; - height: 100vh; - - background: var( - --gradient-dark, - radial-gradient( - 44.09% 58.18% at 100% -14%, - rgba(150, 242, 255, 0.4) 0%, - rgba(150, 242, 255, 0) 61.91% - ), - linear-gradient(181deg, #091824 0%, #2b2f56 100%) - ); - display: flex; - flex-direction: column; - align-items: center; -`; - -export const LogoWrapper = styled.div` - position: absolute; - top: 20px; - left: 20px; -`; - -export const StepListWrapper = styled.div` - height: 5%; - padding: 32px; - width: 100%; - display: inline-flex; - justify-content: center; -`; - -export const PageContainer = styled.div` - height: 100vh; -`; - -export const CardWrapper = styled.div` - height: 85%; -`; diff --git a/frontend/webapp/app/globals.css b/frontend/webapp/app/globals.css new file mode 100644 index 000000000..6bbdf7e7c --- /dev/null +++ b/frontend/webapp/app/globals.css @@ -0,0 +1,4 @@ +/* Preload key fonts in your global CSS */ +@import url('https://fonts.googleapis.com/css2?family=Inter:wght@400;700&display=swap'); +@import url('https://fonts.googleapis.com/css2?family=Kode+Mono:wght@100;200;300;400;500;600;700&display=swap'); +@import url('https://fonts.googleapis.com/css2?family=Inter+Tight:wght@400;700&display=swap'); diff --git a/frontend/webapp/app/layout.tsx b/frontend/webapp/app/layout.tsx index 2387fee82..dfee65de7 100644 --- a/frontend/webapp/app/layout.tsx +++ b/frontend/webapp/app/layout.tsx @@ -1,7 +1,9 @@ 'use client'; +import './globals.css'; import React from 'react'; import { useSSE } from '@/hooks'; -import theme from '@/styles/palette'; +import theme from '@/styles/theme'; +import { ApolloWrapper } from '@/lib'; import { ThemeProvider } from 'styled-components'; import { NotificationManager } from '@/components'; import ReduxProvider from '@/store/redux-provider'; @@ -14,7 +16,6 @@ const LAYOUT_STYLE: React.CSSProperties = { scrollbarWidth: 'none', width: '100vw', height: '100vh', - backgroundColor: theme.colors.dark, }; export default function RootLayout({ @@ -36,16 +37,18 @@ export default function RootLayout({ return ( - - - + + + + {/* */} {children} - + {/* */} - - - + {/* */} + + + ); diff --git a/frontend/webapp/app/main/layout.tsx b/frontend/webapp/app/main/layout.tsx new file mode 100644 index 000000000..f6eecf660 --- /dev/null +++ b/frontend/webapp/app/main/layout.tsx @@ -0,0 +1,36 @@ +'use client'; +import React from 'react'; +import styled from 'styled-components'; +import { MainHeader } from '@/components'; + +const LayoutContainer = styled.div` + width: 100%; + height: 100vh; + background-color: ${({ theme }) => theme.colors.primary}; + display: flex; + align-items: center; + flex-direction: column; +`; + +const MainContent = styled.div` + display: flex; + width: 100vw; + height: 76px; + flex-direction: column; + align-items: center; +`; + +export default function MainLayout({ + children, +}: { + children: React.ReactNode; +}) { + return ( + + + + {children} + + + ); +} diff --git a/frontend/webapp/app/main/page.tsx b/frontend/webapp/app/main/page.tsx new file mode 100644 index 000000000..a2227ccd0 --- /dev/null +++ b/frontend/webapp/app/main/page.tsx @@ -0,0 +1,11 @@ +'use client'; +import React from 'react'; +import { OverviewDataFlowContainer } from '@/containers'; + +export default function MainPage() { + return ( + <> + + + ); +} diff --git a/frontend/webapp/app/page.tsx b/frontend/webapp/app/page.tsx index bb5248607..ec28d1ded 100644 --- a/frontend/webapp/app/page.tsx +++ b/frontend/webapp/app/page.tsx @@ -1,27 +1,18 @@ 'use client'; import { useEffect } from 'react'; -import { useQuery } from 'react-query'; +import { useConfig } from '@/hooks'; +import { ROUTES, CONFIG } from '@/utils'; import { useRouter } from 'next/navigation'; -import { ROUTES, CONFIG, QUERIES } from '@/utils'; -import { Loader } from '@keyval-dev/design-system'; -import { getDestinations, getConfig } from '@/services'; import { addNotification, store } from '@/store'; +import { Loader } from '@keyval-dev/design-system'; + export default function App() { const router = useRouter(); - const { data, isLoading: isConfigLoading } = useQuery( - [QUERIES.API_CONFIG], - getConfig - ); - const { - isLoading: isDestinationLoading, - data: destinationList, - error, - } = useQuery([QUERIES.API_DESTINATIONS], getDestinations); - useEffect(() => { - if (isConfigLoading || isDestinationLoading) return; + const { data, error } = useConfig(); - renderCurrentPage(); - }, [data, destinationList]); + useEffect(() => { + data && renderCurrentPage(); + }, [data, error]); useEffect(() => { if (!error) return; @@ -41,11 +32,6 @@ export default function App() { function renderCurrentPage() { const { installation } = data; - if (destinationList.length > 0) { - router.push(ROUTES.OVERVIEW); - return; - } - switch (installation) { case CONFIG.NEW: case CONFIG.APPS_SELECTED: diff --git a/frontend/webapp/components/common/card-details/index.tsx b/frontend/webapp/components/common/card-details/index.tsx new file mode 100644 index 000000000..184ebb2af --- /dev/null +++ b/frontend/webapp/components/common/card-details/index.tsx @@ -0,0 +1,41 @@ +import React from 'react'; +import styled from 'styled-components'; +import { ConfiguredFields } from '@/components'; +import { Text } from '@/reuseable-components'; +interface CardDetailsProps { + data: { + title: string; + value: string; + }[]; + title?: string; +} + +const CardDetails: React.FC = ({ + data, + title = 'Details', +}) => { + return ( + + + {title} + + + + ); +}; + +export { CardDetails }; + +const Container = styled.div` + display: flex; + flex-direction: column; + padding: 16px 24px 24px 24px; + flex-direction: column; + align-items: flex-start; + gap: 16px; + align-self: stretch; + border-radius: 24px; + border: 1px solid ${({ theme }) => theme.colors.border}; +`; + +const TitleWrapper = styled.div``; diff --git a/frontend/webapp/components/common/configured-fields/index.tsx b/frontend/webapp/components/common/configured-fields/index.tsx new file mode 100644 index 000000000..591e1e550 --- /dev/null +++ b/frontend/webapp/components/common/configured-fields/index.tsx @@ -0,0 +1,78 @@ +import React from 'react'; +import styled from 'styled-components'; +import { Text } from '@/reuseable-components'; + +type TypeDetail = { + title: string; + value: string; +}; + +type ConfiguredFieldsProps = { + details: TypeDetail[]; +}; + +const ListContainer = styled.div` + display: flex; + flex-wrap: wrap; + gap: 24px 40px; +`; + +const ListItem = styled.div``; + +const ItemTitle = styled(Text)` + color: #b8b8b8; + font-size: 10px; + line-height: 16px; +`; + +const ItemValue = styled(Text)` + color: ${({ theme }) => theme.colors.text}; + font-size: 12px; + line-height: 18px; +`; + +export const ConfiguredFields: React.FC = ({ + details, +}) => { + const parseValue = (value: any) => { + try { + const parsed = JSON.parse(value); + if (typeof parsed === 'string') { + return parsed; + } + + if (Array.isArray(parsed)) { + return parsed + .map((item) => { + if (typeof item === 'object' && item !== null) { + return `${item.key}: ${item.value}`; + } + + return item; + }) + .join(', '); + } + + // Handle objects (non-array JSON objects) + if (typeof parsed === 'object' && parsed !== null) { + return Object.entries(parsed) + .map(([key, val]) => `${key}: ${val}`) + .join(', '); + } + } catch (error) { + return value; + } + return value; + }; + + return ( + + {details.map((detail, index) => ( + + {detail.title} + {parseValue(detail.value)} + + ))} + + ); +}; diff --git a/frontend/webapp/components/common/index.ts b/frontend/webapp/components/common/index.ts index d60373d11..bc8f954d1 100644 --- a/frontend/webapp/components/common/index.ts +++ b/frontend/webapp/components/common/index.ts @@ -1,2 +1,4 @@ export * from './multi.checkbox'; export * from './conditions.check'; +export * from './card-details'; +export * from './configured-fields'; diff --git a/frontend/webapp/components/destinations/add-destination-button/index.tsx b/frontend/webapp/components/destinations/add-destination-button/index.tsx new file mode 100644 index 000000000..281d403c7 --- /dev/null +++ b/frontend/webapp/components/destinations/add-destination-button/index.tsx @@ -0,0 +1,33 @@ +import React from 'react'; +import Image from 'next/image'; +import theme from '@/styles/theme'; +import styled from 'styled-components'; +import { Button, Text } from '@/reuseable-components'; + +const StyledAddDestinationButton = styled(Button)` + display: flex; + align-items: center; + justify-content: center; + gap: 8px; + width: 100%; +`; + +interface ModalActionComponentProps { + onClick: () => void; +} + +export function AddDestinationButton({ onClick }: ModalActionComponentProps) { + return ( + + back + + ADD DESTINATION + + + ); +} diff --git a/frontend/webapp/components/destinations/edit-destination-form/index.tsx b/frontend/webapp/components/destinations/edit-destination-form/index.tsx new file mode 100644 index 000000000..8388edb97 --- /dev/null +++ b/frontend/webapp/components/destinations/edit-destination-form/index.tsx @@ -0,0 +1,45 @@ +import React from 'react'; +import { CheckboxList } from '@/reuseable-components'; +import { DynamicConnectDestinationFormFields } from '@/containers/main/destinations/add-destination/dynamic-form-fields'; +import { + DynamicField, + ExportedSignals, + SupportedDestinationSignals, +} from '@/types'; + +interface DestinationFormProps { + dynamicFields: DynamicField[]; + exportedSignals: ExportedSignals; + supportedSignals: SupportedDestinationSignals; + handleDynamicFieldChange: (name: string, value: any) => void; + handleSignalChange: (signal: keyof ExportedSignals, value: boolean) => void; +} + +export const EditDestinationForm: React.FC = ({ + dynamicFields, + exportedSignals, + supportedSignals, + handleSignalChange, + handleDynamicFieldChange, +}) => { + const monitors = [ + supportedSignals.logs.supported && { id: 'logs', title: 'Logs' }, + supportedSignals.metrics.supported && { id: 'metrics', title: 'Metrics' }, + supportedSignals.traces.supported && { id: 'traces', title: 'Traces' }, + ].filter(Boolean); + + return ( + <> + + + + ); +}; diff --git a/frontend/webapp/components/destinations/index.ts b/frontend/webapp/components/destinations/index.ts new file mode 100644 index 000000000..e852a65cc --- /dev/null +++ b/frontend/webapp/components/destinations/index.ts @@ -0,0 +1,3 @@ +export * from './add-destination-button'; +export * from './monitors-tap-list'; +export * from './edit-destination-form'; diff --git a/frontend/webapp/components/destinations/monitors-tap-list/index.tsx b/frontend/webapp/components/destinations/monitors-tap-list/index.tsx new file mode 100644 index 000000000..fbc4685b4 --- /dev/null +++ b/frontend/webapp/components/destinations/monitors-tap-list/index.tsx @@ -0,0 +1,53 @@ +import React from 'react'; +import styled from 'styled-components'; +import { Text, Tag } from '@/reuseable-components'; +import { MONITORS_OPTIONS } from '@/utils'; +import Image from 'next/image'; + +interface MonitorButtonsProps { + selectedMonitors: string[]; + onMonitorSelect: (monitor: string) => void; +} + +const MonitorButtonsContainer = styled.div` + display: flex; + gap: 8px; + margin-left: 12px; +`; + +const MonitorsTitle = styled(Text)` + opacity: 0.8; + font-size: 14px; + margin-left: 32px; +`; + +const MonitorsTapList: React.FC = ({ + selectedMonitors, + onMonitorSelect, +}) => { + return ( + <> + Monitor by: + + {MONITORS_OPTIONS.map((monitor) => ( + onMonitorSelect(monitor.id)} + > + monitor + {monitor.value} + + ))} + + + ); +}; + +export { MonitorsTapList }; diff --git a/frontend/webapp/components/index.ts b/frontend/webapp/components/index.ts index c03b571ed..f047da4e2 100644 --- a/frontend/webapp/components/index.ts +++ b/frontend/webapp/components/index.ts @@ -4,3 +4,6 @@ export * from './overview'; export * from './common'; export * from './notification/notification-manager'; export * from './notification/notification-list'; +export * from './destinations'; +export * from './main'; +export * from './modals'; diff --git a/frontend/webapp/components/main/header/cp-title/index.tsx b/frontend/webapp/components/main/header/cp-title/index.tsx new file mode 100644 index 000000000..c7bf856d2 --- /dev/null +++ b/frontend/webapp/components/main/header/cp-title/index.tsx @@ -0,0 +1,51 @@ +import React from 'react'; +import Image from 'next/image'; +import styled from 'styled-components'; +import { Text } from '@/reuseable-components'; + +interface PlatformProps { + type: 'k8s' | 'vm'; +} + +const PlatformWrapper = styled.div` + display: flex; + align-items: center; + padding: 10px; +`; + +const IconWrapper = styled.div` + margin-right: 10px; +`; + +const TextWrapper = styled.div` + display: flex; + align-items: center; +`; + +const Title = styled(Text)` + font-size: 14px; + margin-right: 10px; + color: ${({ theme }) => theme.colors.white}; +`; + +const PlatformTitle: React.FC = ({ type }) => { + return ( + + + {type} + + + + {type === 'k8s' ? 'Kubernetes Cluster' : 'Virtual Machine'} + + + + ); +}; + +export { PlatformTitle }; diff --git a/frontend/webapp/components/main/header/index.tsx b/frontend/webapp/components/main/header/index.tsx new file mode 100644 index 000000000..aa33bb0c2 --- /dev/null +++ b/frontend/webapp/components/main/header/index.tsx @@ -0,0 +1,45 @@ +import React from 'react'; +import Image from 'next/image'; +import styled from 'styled-components'; +import { ConnectionStatus } from '@/reuseable-components'; +import { PlatformTitle } from './cp-title'; + +interface MainHeaderProps {} + +const HeaderContainer = styled.div` + display: flex; + padding: 12px 0; + align-items: center; + background-color: ${({ theme }) => theme.colors.dark_grey}; + border-bottom: 1px solid rgba(249, 249, 249, 0.16); + width: 100%; +`; + +const Logo = styled.div` + display: flex; + align-items: center; + margin-left: 32px; +`; + +const PlatformTitleWrapper = styled.div` + margin-left: 32px; +`; + +export const MainHeader: React.FC = () => { + return ( + + + logo + + + + + + + ); +}; diff --git a/frontend/webapp/components/main/index.tsx b/frontend/webapp/components/main/index.tsx new file mode 100644 index 000000000..677ca79d4 --- /dev/null +++ b/frontend/webapp/components/main/index.tsx @@ -0,0 +1 @@ +export * from './header'; diff --git a/frontend/webapp/components/modals/delete-entity-modal/index.tsx b/frontend/webapp/components/modals/delete-entity-modal/index.tsx new file mode 100644 index 000000000..ac771fc72 --- /dev/null +++ b/frontend/webapp/components/modals/delete-entity-modal/index.tsx @@ -0,0 +1,73 @@ +import React, { useCallback } from 'react'; +import { Button, Modal, Text } from '@/reuseable-components'; +import styled from 'styled-components'; + +interface AddActionModalProps { + title: string; + description: string; + isModalOpen: boolean; + handleDelete: () => void; + handleCloseModal: () => void; +} + +export const DeleteEntityModal: React.FC = ({ + isModalOpen, + handleCloseModal, + title = '', + handleDelete, + description = '', +}) => { + const handleClose = useCallback(() => { + handleCloseModal(); + }, [handleCloseModal]); + + return ( + + + Delete {title} + + {description} + + + + Delete + + + Cancel + + + + + ); +}; + +const ModalTitle = styled(Text)` + font-size: 20px; + line-height: 28px; +`; + +const ModalDescription = styled(Text)` + color: ${({ theme }) => theme.text.grey}; + width: 416px; + font-style: normal; + font-weight: 300; + line-height: 24px; +`; + +const ModalContent = styled.div` + padding: 12px 0px 32px 0; +`; + +const ModalFooter = styled.div` + display: flex; + justify-content: space-between; + gap: 12px; +`; + +const FooterButton = styled(Button)` + width: 224px; +`; + +const DeleteEntityModalContainer = styled.div` + padding: 24px 32px; +`; diff --git a/frontend/webapp/components/modals/index.tsx b/frontend/webapp/components/modals/index.tsx new file mode 100644 index 000000000..5b27ff586 --- /dev/null +++ b/frontend/webapp/components/modals/index.tsx @@ -0,0 +1 @@ +export * from './delete-entity-modal'; diff --git a/frontend/webapp/components/setup/connection/create.connection.form/create.connection.form.tsx b/frontend/webapp/components/setup/connection/create.connection.form/create.connection.form.tsx index e047df7cd..98112cbed 100644 --- a/frontend/webapp/components/setup/connection/create.connection.form/create.connection.form.tsx +++ b/frontend/webapp/components/setup/connection/create.connection.form/create.connection.form.tsx @@ -1,7 +1,7 @@ 'use client'; import React, { useState, useEffect } from 'react'; import theme from '@/styles/palette'; -import { useCheckConnection, useKeyDown } from '@/hooks'; +import { useTestConnection, useKeyDown } from '@/hooks'; import { Field, SelectedDestination } from '@/types'; import { renderFields } from './dynamic.fields'; import { @@ -81,7 +81,7 @@ export function CreateConnectionForm({ destinationNameValue || '' ); - const { checkDestinationConnection, isLoading } = useCheckConnection(); + const { testConnection } = useTestConnection(); useEffect(() => { setInitialDynamicFields(); @@ -209,7 +209,7 @@ export function CreateConnectionForm({ type: destination.type, }; try { - checkDestinationConnection(body, setIsConnectionTested); + // testConnection(body); } catch (error) {} } @@ -252,7 +252,8 @@ export function CreateConnectionForm({ disabled={isCreateButtonDisabled} onClick={handleCheckDestinationConnection} > - {isLoading ? ( +
+ {/* {isLoading ? ( ) : isConnectionTested.enabled === null ? ( @@ -266,7 +267,7 @@ export function CreateConnectionForm({ {isConnectionTested.message} - )} + )} */} )} void; + variant?: 'primary' | 'secondary'; + disabled?: boolean; + }[]; +} + +const HeaderContainer = styled.div` + display: flex; + justify-content: space-between; + padding: 0 24px 0 32px; + align-items: center; + background-color: ${({ theme }) => theme.colors.dark_grey}; + border-bottom: 1px solid rgba(249, 249, 249, 0.16); + height: 80px; +`; + +const Title = styled(Text)``; + +const Logo = styled.div` + display: flex; + align-items: center; + font-size: 1.2em; +`; + +const NavigationButtonsWrapper = styled.div` + position: absolute; + right: 24px; +`; + +export const SetupHeader: React.FC = ({ + navigationButtons, +}) => { + return ( + + + logo + + START WITH ODIGOS +
+ + + + + ); +}; diff --git a/frontend/webapp/components/setup/headers/index.tsx b/frontend/webapp/components/setup/headers/index.tsx index fc5486a21..ce9c51325 100644 --- a/frontend/webapp/components/setup/headers/index.tsx +++ b/frontend/webapp/components/setup/headers/index.tsx @@ -2,3 +2,4 @@ export * from './choose-destination-header'; export * from './choose-sources-header'; export * from './connect-destination-header'; export * from './back-button'; +export * from './header'; diff --git a/frontend/webapp/components/setup/index.tsx b/frontend/webapp/components/setup/index.tsx index e2f355a8b..b45b6ee9c 100644 --- a/frontend/webapp/components/setup/index.tsx +++ b/frontend/webapp/components/setup/index.tsx @@ -6,3 +6,4 @@ export { ConnectionsIcons } from './connection/connections_icons/connections_ico export { CreateConnectionForm } from './connection/create.connection.form/create.connection.form'; export { QuickHelp } from './connection/quick.help/quick.help'; export * from './headers'; +export * from './menu'; diff --git a/frontend/webapp/components/setup/menu/index.tsx b/frontend/webapp/components/setup/menu/index.tsx new file mode 100644 index 000000000..5627c8e10 --- /dev/null +++ b/frontend/webapp/components/setup/menu/index.tsx @@ -0,0 +1,147 @@ +import Image from 'next/image'; +import { StepProps } from '@/types'; +import React, { useEffect } from 'react'; +import { Text } from '@/reuseable-components'; +import styled, { css } from 'styled-components'; + +const Container = styled.div` + display: flex; + flex-direction: column; + gap: 32px; +`; + +const Step = styled.div<{ state: 'finish' | 'active' | 'disabled' }>` + display: flex; + gap: 16px; + padding: 8px; + opacity: ${({ state }) => (state === 'disabled' ? 0.5 : 1)}; + transition: all 0.3s; + + ${({ state }) => + state === 'finish' && + css` + opacity: 0.8; + `} + + ${({ state }) => state === 'active' && css``} + + ${({ state }) => + state === 'disabled' && + css` + opacity: 0.5; + `} + + & + & { + margin-top: 10px; + } +`; + +const IconWrapper = styled.div<{ state: 'finish' | 'active' | 'disabled' }>` + border-radius: 32px; + width: 24px; + height: 24px; + border: 1px solid ${({ theme }) => theme.colors.secondary}; + display: flex; + justify-content: center; + align-items: center; + + ${({ state }) => + state === 'finish' + ? css` + opacity: 0.8; + ` + : state === 'disabled' && + css` + border: 1px dashed rgba(249, 249, 249, 0.4); + `} +`; + +const StepContent = styled.div` + display: flex; + justify-content: center; + flex-direction: column; + gap: 8px; +`; + +const StepTitle = styled(Text)` + font-weight: 500; +`; + +const StepSubtitle = styled(Text)``; + +const SideMenu: React.FC<{ data?: StepProps[]; currentStep?: number }> = ({ + data, + currentStep, +}) => { + const [stepsList, setStepsList] = React.useState([]); + const steps: StepProps[] = data || [ + { + title: 'INSTALLATION', + subtitle: 'Success', + state: 'finish', + stepNumber: 1, + }, + { + title: 'SOURCES', + state: 'active', + subtitle: '', + + stepNumber: 2, + }, + { + title: 'DESTINATIONS', + state: 'disabled', + stepNumber: 3, + }, + ]; + useEffect(() => { + if (currentStep) { + const currentSteps = (data || steps).map((step, index) => { + if (index < currentStep - 1) { + return { ...step, state: 'finish' as const }; + } else if (index === currentStep - 1) { + return { ...step, state: 'active' as const }; + } else { + return { ...step, state: 'disabled' as const }; + } + }); + + setStepsList(currentSteps); + } + }, [currentStep, data]); + + return ( + + {stepsList.map((step, index) => ( + + + {step.state === 'finish' && ( + {''} + )} + {step.state === 'active' && ( + {step.stepNumber} + )} + {step.state === 'disabled' && ( + {step.stepNumber} + )} + + + {step.title} + {step.subtitle && ( + + {step.subtitle} + + )} + + + ))} + + ); +}; + +export { SideMenu }; diff --git a/frontend/webapp/containers/main/actions/choose-action-modal/action-options.ts b/frontend/webapp/containers/main/actions/choose-action-modal/action-options.ts new file mode 100644 index 000000000..b0e342e3c --- /dev/null +++ b/frontend/webapp/containers/main/actions/choose-action-modal/action-options.ts @@ -0,0 +1,59 @@ +import { ActionsType } from '@/types'; + +export const ACTION_OPTIONS = [ + { + id: 'add_cluster_info', + label: 'Add Cluster Info', + description: 'Add static cluster-scoped attributes to your data.', + type: ActionsType.ADD_CLUSTER_INFO, + icon: '/icons/actions/addclusterinfo.svg', + }, + { + id: 'delete_attribute', + label: 'Delete Attribute', + description: 'Delete attributes from logs, metrics, and traces.', + type: ActionsType.DELETE_ATTRIBUTES, + icon: '/icons/actions/deleteattribute.svg', + }, + { + id: 'rename_attribute', + label: 'Rename Attribute', + description: 'Rename attributes in logs, metrics, and traces.', + type: ActionsType.RENAME_ATTRIBUTES, + icon: '/icons/actions/renameattribute.svg', + }, + { + id: 'pii-masking', + label: 'PII Masking', + description: 'Mask PII data in your traces.', + type: ActionsType.PII_MASKING, + icon: '/icons/actions/piimasking.svg', + }, + { + id: 'sampler', + label: 'Samplers', + description: '', + type: ActionsType.PROBABILISTIC_SAMPLER, + icon: '/icons/actions/sampler.svg', + items: [ + { + id: 'error-sampler', + label: 'Error Sampler', + description: 'Sample errors based on percentage.', + type: ActionsType.ERROR_SAMPLER, + }, + { + id: 'probabilistic-sampler', + label: 'Probabilistic Sampler', + description: 'Sample traces based on percentage.', + type: ActionsType.PROBABILISTIC_SAMPLER, + }, + { + id: 'latency-action', + label: 'Latency Action', + description: 'Add latency to your traces.', + type: ActionsType.LATENCY_SAMPLER, + }, + ], + }, +]; diff --git a/frontend/webapp/containers/main/actions/choose-action-modal/index.tsx b/frontend/webapp/containers/main/actions/choose-action-modal/index.tsx new file mode 100644 index 000000000..977d632b2 --- /dev/null +++ b/frontend/webapp/containers/main/actions/choose-action-modal/index.tsx @@ -0,0 +1,92 @@ +import React, { useRef, useCallback } from 'react'; +import { + AutocompleteInput, + Modal, + NavigationButtons, + Text, +} from '@/reuseable-components'; +import styled from 'styled-components'; +import { ACTION_OPTIONS } from './action-options'; + +const DefineActionContainer = styled.section` + height: 640px; + padding: 0px 220px; + display: flex; + flex-direction: column; +`; + +const HeaderWrapper = styled.div` + display: flex; + flex-direction: column; + justify-content: flex-start; + align-items: flex-start; + gap: 16px; + max-width: 640px; + margin: 32px 0 24px 0; +`; + +const SubTitle = styled(Text)` + color: ${({ theme }) => theme.text.grey}; + line-height: 150%; +`; + +interface AddActionModalProps { + isModalOpen: boolean; + handleCloseModal: () => void; +} + +interface ModalActionComponentProps { + onNext: () => void; +} + +const ModalActionComponent: React.FC = React.memo( + ({ onNext }) => { + const buttons = [ + { + label: 'DONE', + onClick: onNext, + variant: 'primary' as const, + }, + ]; + + return ; + } +); + +export const AddActionModal: React.FC = ({ + isModalOpen, + handleCloseModal, +}) => { + const submitRef = useRef<(() => void) | null>(null); + + const handleNext = useCallback(() => { + if (submitRef.current) { + handleCloseModal(); + } + }, [handleCloseModal]); + + const handleClose = useCallback(() => { + handleCloseModal(); + }, [handleCloseModal]); + + return ( + } + header={{ title: 'Add Action' }} + onClose={handleClose} + > + + + {'Define Action'} + + { + 'Actions are a way to modify the OpenTelemetry data recorded by Odigos sources before it is exported to your Odigos destinations. Choose an action type and provide necessary information.' + } + + + + + + ); +}; diff --git a/frontend/webapp/containers/main/actions/index.ts b/frontend/webapp/containers/main/actions/index.ts index 53803aef1..7fce4982a 100644 --- a/frontend/webapp/containers/main/actions/index.ts +++ b/frontend/webapp/containers/main/actions/index.ts @@ -2,3 +2,4 @@ export * from './managed'; export * from './choose-action'; export * from './edit-action'; export * from './create-action'; +export * from './choose-action-modal'; diff --git a/frontend/webapp/containers/main/destinations/add-destination/add-destination-modal/index.tsx b/frontend/webapp/containers/main/destinations/add-destination/add-destination-modal/index.tsx new file mode 100644 index 000000000..ffb5de923 --- /dev/null +++ b/frontend/webapp/containers/main/destinations/add-destination/add-destination-modal/index.tsx @@ -0,0 +1,102 @@ +import React, { useState, useRef, useCallback } from 'react'; +import { DestinationTypeItem } from '@/types'; +import { Modal, NavigationButtons } from '@/reuseable-components'; +import { ChooseDestinationModalBody } from '../choose-destination-modal-body'; +import { ConnectDestinationModalBody } from '../connect-destination-modal-body'; + +interface AddDestinationModalProps { + isModalOpen: boolean; + handleCloseModal: () => void; +} + +interface ModalActionComponentProps { + onNext: () => void; + onBack: () => void; + isFormValid?: boolean; + item?: DestinationTypeItem; +} + +const ModalActionComponent: React.FC = React.memo( + ({ onNext, onBack, isFormValid, item }) => { + if (!item) return null; + + const buttons = [ + { + label: 'BACK', + iconSrc: '/icons/common/arrow-white.svg', + onClick: onBack, + variant: 'secondary' as const, + }, + { + label: 'DONE', + onClick: onNext, + variant: 'primary' as const, + disabled: !isFormValid, + }, + ]; + + return ; + } +); + +export const AddDestinationModal: React.FC = ({ + isModalOpen, + handleCloseModal, +}) => { + const submitRef = useRef<(() => void) | null>(null); + const [selectedItem, setSelectedItem] = useState< + DestinationTypeItem | undefined + >(); + const [isFormValid, setIsFormValid] = useState(false); + + const handleNextStep = useCallback((item: DestinationTypeItem) => { + setSelectedItem(item); + }, []); + + const handleNext = useCallback(() => { + if (submitRef.current) { + submitRef.current(); + setSelectedItem(undefined); + handleCloseModal(); + } + }, [handleCloseModal]); + + const handleBack = useCallback(() => { + setSelectedItem(undefined); + }, []); + + const handleClose = useCallback(() => { + setSelectedItem(undefined); + handleCloseModal(); + }, [handleCloseModal]); + + const renderModalBody = () => { + return selectedItem ? ( + + ) : ( + + ); + }; + + return ( + + } + header={{ title: 'Add Destination' }} + onClose={handleClose} + > + {renderModalBody()} + + ); +}; diff --git a/frontend/webapp/containers/main/destinations/add-destination/choose-destination-menu/index.tsx b/frontend/webapp/containers/main/destinations/add-destination/choose-destination-menu/index.tsx new file mode 100644 index 000000000..f8f730168 --- /dev/null +++ b/frontend/webapp/containers/main/destinations/add-destination/choose-destination-menu/index.tsx @@ -0,0 +1,90 @@ +import React, { useState } from 'react'; +import styled from 'styled-components'; +import { DropdownOption } from '@/types'; +import { MONITORS_OPTIONS } from '@/utils'; +import { Checkbox, Dropdown, Input } from '@/reuseable-components'; + +interface FilterComponentProps { + selectedTag: DropdownOption | undefined; + onTagSelect: (option: DropdownOption) => void; + onSearch: (value: string) => void; + selectedMonitors: string[]; + onMonitorSelect: (monitor: string) => void; +} + +const InputAndDropdownContainer = styled.div` + display: flex; + gap: 12px; + width: 370px; +`; + +const FilterContainer = styled.div` + display: flex; + align-items: center; + padding: 24px 0; +`; + +const MonitorButtonsContainer = styled.div` + display: flex; + gap: 32px; + margin-left: 32px; +`; + +const DROPDOWN_OPTIONS = [ + { value: 'All types', id: 'all' }, + { value: 'Managed', id: 'managed' }, + { value: 'Self-hosted', id: 'self hosted' }, +]; + +const DestinationFilterComponent: React.FC = ({ + selectedTag, + selectedMonitors, + onTagSelect, + onSearch, + onMonitorSelect, +}) => { + const [searchTerm, setSearchTerm] = useState(''); + + const handleSearchChange = (e: React.ChangeEvent) => { + const value = e.target.value; + setSearchTerm(value); + onSearch(value); + }; + + return ( + + +
+ +
+ +
+ + {MONITORS_OPTIONS.map((monitor) => ( + onMonitorSelect(monitor.id)} + disabled={ + selectedMonitors.length === 1 && + selectedMonitors.includes(monitor.id) + } + /> + ))} + +
+ ); +}; + +export { DestinationFilterComponent }; diff --git a/frontend/webapp/containers/main/destinations/add-destination/choose-destination-modal-body/index.tsx b/frontend/webapp/containers/main/destinations/add-destination/choose-destination-modal-body/index.tsx new file mode 100644 index 000000000..a0e09537f --- /dev/null +++ b/frontend/webapp/containers/main/destinations/add-destination/choose-destination-modal-body/index.tsx @@ -0,0 +1,106 @@ +import React, { useMemo, useState } from 'react'; +import { SideMenu } from '@/components'; +import { useDestinationTypes } from '@/hooks'; +import { DestinationsList } from '../destinations-list'; +import { Body, Container, SideMenuWrapper } from '../styled'; +import { Divider, SectionTitle } from '@/reuseable-components'; +import { DestinationFilterComponent } from '../choose-destination-menu'; +import { StepProps, DropdownOption, DestinationTypeItem } from '@/types'; + +interface ChooseDestinationModalBodyProps { + onSelect: (item: DestinationTypeItem) => void; +} + +const SIDE_MENU_DATA: StepProps[] = [ + { + title: 'DESTINATIONS', + state: 'active', + stepNumber: 1, + }, + { + title: 'CONNECTION', + state: 'disabled', + stepNumber: 2, + }, +]; + +const DEFAULT_MONITORS = ['logs', 'metrics', 'traces']; +const DEFAULT_DROPDOWN_VALUE = { id: 'all', value: 'All types' }; + +export function ChooseDestinationModalBody({ + onSelect, +}: ChooseDestinationModalBodyProps) { + const [searchValue, setSearchValue] = useState(''); + const [selectedMonitors, setSelectedMonitors] = + useState(DEFAULT_MONITORS); + const [dropdownValue, setDropdownValue] = useState( + DEFAULT_DROPDOWN_VALUE + ); + + const { destinations } = useDestinationTypes(); + + function handleTagSelect(option: DropdownOption) { + setDropdownValue(option); + } + + const filteredDestinations = useMemo(() => { + return destinations + .map((category) => { + const filteredItems = category.items.filter((item) => { + const matchesSearch = searchValue + ? item.displayName.toLowerCase().includes(searchValue.toLowerCase()) + : true; + + const matchesDropdown = + dropdownValue.id !== 'all' + ? category.name === dropdownValue.id + : true; + + const matchesMonitor = selectedMonitors.length + ? selectedMonitors.some( + (monitor) => item.supportedSignals[monitor]?.supported + ) + : true; + + return matchesSearch && matchesDropdown && matchesMonitor; + }); + + return { ...category, items: filteredItems }; + }) + .filter((category) => category.items.length > 0); // Filter out empty categories + }, [destinations, searchValue, dropdownValue, selectedMonitors]); + + function onMonitorSelect(monitor: string) { + if (selectedMonitors.includes(monitor)) { + setSelectedMonitors(selectedMonitors.filter((item) => item !== monitor)); + } else { + setSelectedMonitors([...selectedMonitors, monitor]); + } + } + + return ( + + + + + + + + + + + + ); +} diff --git a/frontend/webapp/containers/main/destinations/add-destination/configured-destinations-list/index.tsx b/frontend/webapp/containers/main/destinations/add-destination/configured-destinations-list/index.tsx new file mode 100644 index 000000000..f650c2980 --- /dev/null +++ b/frontend/webapp/containers/main/destinations/add-destination/configured-destinations-list/index.tsx @@ -0,0 +1,199 @@ +import React from 'react'; +import Image from 'next/image'; +import styled from 'styled-components'; +import { ConfiguredFields } from '@/components'; +import { ConfiguredDestination } from '@/types'; +import { Divider, Text } from '@/reuseable-components'; + +const Container = styled.div` + display: flex; + flex-direction: column; + align-items: flex-start; + gap: 12px; + margin-top: 24px; + align-self: stretch; + height: 100%; + max-height: 548px; + overflow-y: auto; +`; + +const ListItem = styled.div` + width: 100%; + border-radius: 16px; + background: ${({ theme }) => theme.colors.translucent_bg}; +`; + +const ListItemBody = styled.div` + width: 100%; + padding: 16px; +`; + +const ListItemHeader = styled.div` + display: flex; + align-items: center; + justify-content: space-between; + width: 100%; + padding: 16px 0px; +`; + +const ListItemContent = styled.div` + margin-left: 16px; + display: flex; + gap: 12px; +`; + +const DestinationIconWrapper = styled.div` + display: flex; + width: 36px; + height: 36px; + justify-content: center; + align-items: center; + gap: 8px; + border-radius: 8px; + background: linear-gradient( + 180deg, + rgba(249, 249, 249, 0.06) 0%, + rgba(249, 249, 249, 0.02) 100% + ); +`; + +const SignalsWrapper = styled.div` + display: flex; + align-items: center; + gap: 4px; +`; + +const SignalText = styled(Text)` + color: rgba(249, 249, 249, 0.8); + font-size: 10px; + text-transform: capitalize; +`; + +const TextWrapper = styled.div` + display: flex; + flex-direction: column; + height: 36px; + justify-content: space-between; +`; + +const ExpandIconContainer = styled.div` + display: flex; + justify-content: center; + align-items: center; + margin-right: 16px; +`; + +const IconBorder = styled.div` + height: 16px; + width: 1px; + margin-right: 12px; + background: ${({ theme }) => theme.colors.border}; +`; + +const ExpandIconWrapper = styled.div<{ expand?: boolean }>` + display: flex; + width: 36px; + height: 36px; + cursor: pointer; + justify-content: center; + align-items: center; + border-radius: 100%; + transition: background 0.3s ease 0s, transform 0.3s ease 0s; + transform: ${({ expand }) => (expand ? 'rotate(180deg)' : 'rotate(0deg)')}; + &:hover { + background: ${({ theme }) => theme.colors.translucent_bg}; + } +`; + +interface DestinationsListProps { + data: ConfiguredDestination[]; +} + +function ConfiguredDestinationsListItem({ + item, +}: { + item: ConfiguredDestination; +}) { + const [expand, setExpand] = React.useState(false); + + function renderSupportedSignals(item: ConfiguredDestination) { + const supportedSignals = item.exportedSignals; + const signals = Object.keys(supportedSignals); + const supportedSignalsList = signals.filter( + (signal) => supportedSignals[signal].supported + ); + + return Object.keys(supportedSignals).map( + (signal, index) => + supportedSignals[signal] && ( + + monitor + + {signal} + {index < supportedSignalsList.length - 1 && ( + · + )} + + ) + ); + } + + return ( + + + + + destination + + + {item.displayName} + {renderSupportedSignals(item)} + + + + + + setExpand(!expand)}> + destination + + + + + {expand && ( + + + + + )} + + ); +} + +const ConfiguredDestinationsList: React.FC = ({ + data, +}) => { + return ( + + {data.map((item) => ( + + ))} + + ); +}; + +export { ConfiguredDestinationsList }; diff --git a/frontend/webapp/containers/main/destinations/add-destination/connect-destination-modal-body/connection-notification.tsx b/frontend/webapp/containers/main/destinations/add-destination/connect-destination-modal-body/connection-notification.tsx new file mode 100644 index 000000000..7cfbac089 --- /dev/null +++ b/frontend/webapp/containers/main/destinations/add-destination/connect-destination-modal-body/connection-notification.tsx @@ -0,0 +1,30 @@ +import { NotificationNote } from '@/reuseable-components'; +import styled from 'styled-components'; + +export const ConnectionNotification = ({ + showConnectionError, + destination, +}) => ( + <> + {showConnectionError && ( + + + + )} + {destination?.fields && !showConnectionError && ( + + + + )} + +); + +const NotificationNoteWrapper = styled.div` + margin-top: 24px; +`; diff --git a/frontend/webapp/containers/main/destinations/add-destination/connect-destination-modal-body/form-container.tsx b/frontend/webapp/containers/main/destinations/add-destination/connect-destination-modal-body/form-container.tsx new file mode 100644 index 000000000..71bd10c1b --- /dev/null +++ b/frontend/webapp/containers/main/destinations/add-destination/connect-destination-modal-body/form-container.tsx @@ -0,0 +1,50 @@ +import styled from 'styled-components'; +import { CheckboxList, Input } from '@/reuseable-components'; +import { DynamicConnectDestinationFormFields } from '../dynamic-form-fields'; + +export const FormContainer = ({ + monitors, + dynamicFields, + exportedSignals, + destinationName, + handleDynamicFieldChange, + handleSignalChange, + setDestinationName, +}) => ( + + + setDestinationName(e.target.value)} + /> + + +); + +const StyledFormContainer = styled.div` + display: flex; + width: 100%; + max-width: 500px; + flex-direction: column; + gap: 24px; + height: 443px; + overflow-y: auto; + padding-right: 16px; + box-sizing: border-box; + overflow: overlay; + max-height: calc(100vh - 410px); + + @media (height < 768px) { + max-height: calc(100vh - 350px); + } +`; diff --git a/frontend/webapp/containers/main/destinations/add-destination/connect-destination-modal-body/index.tsx b/frontend/webapp/containers/main/destinations/add-destination/connect-destination-modal-body/index.tsx new file mode 100644 index 000000000..e1954ce8e --- /dev/null +++ b/frontend/webapp/containers/main/destinations/add-destination/connect-destination-modal-body/index.tsx @@ -0,0 +1,252 @@ +import React, { useEffect, useLayoutEffect, useMemo, useState } from 'react'; +import { useAppStore } from '@/store'; +import { INPUT_TYPES } from '@/utils'; +import { SideMenu } from '@/components'; +import { useQuery } from '@apollo/client'; +import { FormContainer } from './form-container'; +import { TestConnection } from '../test-connection'; +import { GET_DESTINATION_TYPE_DETAILS } from '@/graphql'; +import { Body, Container, SideMenuWrapper } from '../styled'; +import { Divider, SectionTitle } from '@/reuseable-components'; +import { ConnectionNotification } from './connection-notification'; +import { + useConnectDestinationForm, + useConnectEnv, + useDestinationFormData, + useEditDestinationFormHandlers, +} from '@/hooks'; +import { + StepProps, + DestinationInput, + DestinationTypeItem, + DestinationDetailsResponse, + ConfiguredDestination, +} from '@/types'; + +const SIDE_MENU_DATA: StepProps[] = [ + { + title: 'DESTINATIONS', + state: 'finish', + stepNumber: 1, + }, + { + title: 'CONNECTION', + state: 'active', + stepNumber: 2, + }, +]; + +interface ConnectDestinationModalBodyProps { + destination: DestinationTypeItem | undefined; + onSubmitRef: React.MutableRefObject<(() => void) | null>; + onFormValidChange: (isValid: boolean) => void; +} + +export function ConnectDestinationModalBody({ + destination, + onSubmitRef, + onFormValidChange, +}: ConnectDestinationModalBodyProps) { + const [destinationName, setDestinationName] = useState(''); + const [showConnectionError, setShowConnectionError] = useState(false); + + const { + dynamicFields, + exportedSignals, + setDynamicFields, + setExportedSignals, + } = useDestinationFormData(); + + const { connectEnv } = useConnectEnv(); + const { buildFormDynamicFields } = useConnectDestinationForm(); + + const { handleDynamicFieldChange, handleSignalChange } = + useEditDestinationFormHandlers(setExportedSignals, setDynamicFields); + + const addConfiguredDestination = useAppStore( + ({ addConfiguredDestination }) => addConfiguredDestination + ); + + const { data } = useQuery( + GET_DESTINATION_TYPE_DETAILS, + { + variables: { type: destination?.type }, + skip: !destination, + } + ); + + useLayoutEffect(() => { + if (!destination) return; + const { logs, metrics, traces } = destination.supportedSignals; + setExportedSignals({ + logs: logs.supported, + metrics: metrics.supported, + traces: traces.supported, + }); + }, [destination, setExportedSignals]); + + useEffect(() => { + if (data && destination) { + const df = buildFormDynamicFields(data.destinationTypeDetails.fields); + + const newDynamicFields = df.map((field) => { + if (destination.fields && field?.name in destination.fields) { + return { + ...field, + value: destination.fields[field.name], + }; + } + return field; + }); + + setDynamicFields(newDynamicFields); + } + }, [data, destination]); + + useEffect(() => { + // Assign handleSubmit to the onSubmitRef so it can be triggered externally + onSubmitRef.current = handleSubmit; + }, [dynamicFields, destinationName, exportedSignals]); + + useEffect(() => { + const isFormValid = dynamicFields.every((field) => + field.required ? field.value : true + ); + onFormValidChange(isFormValid); + }, [dynamicFields]); + + const monitors = useMemo(() => { + if (!destination) return []; + const { logs, metrics, traces } = destination.supportedSignals; + + return [ + logs.supported && { id: 'logs', title: 'Logs' }, + metrics.supported && { id: 'metrics', title: 'Metrics' }, + traces.supported && { id: 'traces', title: 'Traces' }, + ].filter(Boolean); + }, [destination]); + + function onDynamicFieldChange(name: string, value: any) { + setShowConnectionError(false); + handleDynamicFieldChange(name, value); + } + function processFieldValue(field) { + return field.componentType === INPUT_TYPES.DROPDOWN + ? field.value.value + : field.value; + } + + function processFormFields() { + // Prepare fields for the request body + return dynamicFields.map((field) => ({ + key: field.name, + value: processFieldValue(field), + })); + } + + async function handleSubmit() { + // Prepare fields for the request body + const fields = processFormFields(); + + // Function to store configured destination to display in the UI + function storeConfiguredDestination() { + const destinationTypeDetails = dynamicFields.map((field) => ({ + title: field.title, + value: processFieldValue(field), + })); + + // Add 'Destination name' as the first item + destinationTypeDetails.unshift({ + title: 'Destination name', + value: destinationName, + }); + + // Construct the configured destination object + const storedDestination: ConfiguredDestination = { + exportedSignals, + destinationTypeDetails, + type: destination?.type || '', + imageUrl: destination?.imageUrl || '', + category: '', // Could be handled in a more dynamic way if needed + displayName: destination?.displayName || '', + }; + + // Dispatch action to store the destination + addConfiguredDestination(storedDestination); + } + + // Prepare the request body + const body: DestinationInput = { + name: destinationName, + type: destination?.type || '', + exportedSignals, + fields, + }; + + try { + // Await connection and store the configured destination if successful + await connectEnv(body, storeConfiguredDestination); + } catch (error) { + console.error('Failed to submit destination configuration:', error); + // Handle error (e.g., show notification or alert) + } + } + + if (!destination) return null; + + const actionButton = useMemo(() => { + if (destination.testConnectionSupported) { + return ( + { + setShowConnectionError(true); + onFormValidChange(false); + }} + destination={{ + name: destinationName, + type: destination?.type || '', + exportedSignals, + fields: processFormFields(), + }} + /> + ); + } + return null; + }, [ + destination, + destinationName, + exportedSignals, + processFormFields, + onFormValidChange, + ]); + + return ( + + + + + + + + + + + + + ); +} diff --git a/frontend/webapp/containers/main/destinations/add-destination/destinations-list/destination-list-item/index.tsx b/frontend/webapp/containers/main/destinations/add-destination/destinations-list/destination-list-item/index.tsx new file mode 100644 index 000000000..aa16aea36 --- /dev/null +++ b/frontend/webapp/containers/main/destinations/add-destination/destinations-list/destination-list-item/index.tsx @@ -0,0 +1,121 @@ +import React from 'react'; +import Image from 'next/image'; +import styled from 'styled-components'; +import { DestinationTypeItem } from '@/types'; +import { Text } from '@/reuseable-components'; + +const HoverTextWrapper = styled.div` + visibility: hidden; +`; + +const ListItem = styled.div` + display: flex; + align-items: center; + justify-content: space-between; + width: 100%; + padding: 16px 0px; + transition: background 0.3s; + border-radius: 16px; + cursor: pointer; + background: rgba(249, 249, 249, 0.04); + + &:hover { + background: rgba(249, 249, 249, 0.08); + } + &:last-child { + margin-bottom: 24px; + } + + &:hover { + ${HoverTextWrapper} { + visibility: visible; + } + } +`; + +const ListItemContent = styled.div` + margin-left: 16px; + display: flex; + gap: 12px; +`; + +const DestinationIconWrapper = styled.div` + display: flex; + width: 36px; + height: 36px; + justify-content: center; + align-items: center; + gap: 8px; + border-radius: 8px; + background: linear-gradient( + 180deg, + rgba(249, 249, 249, 0.06) 0%, + rgba(249, 249, 249, 0.02) 100% + ); +`; + +const SignalsWrapper = styled.div` + display: flex; + gap: 4px; +`; + +const SignalText = styled(Text)` + color: rgba(249, 249, 249, 0.8); + font-size: 10px; + text-transform: capitalize; +`; + +const TextWrapper = styled.div` + display: flex; + flex-direction: column; + height: 36px; + justify-content: space-between; +`; + +const HoverText = styled(Text)` + font-family: ${({ theme }) => theme.font_family.secondary}; + text-transform: uppercase; + margin-right: 16px; +`; + +interface DestinationListItemProps { + item: DestinationTypeItem; + onSelect: (item: DestinationTypeItem) => void; +} + +const DestinationListItem: React.FC = ({ + item, + onSelect, +}) => { + const renderSupportedSignals = () => { + const signals = Object.keys(item.supportedSignals).filter( + (signal) => item.supportedSignals[signal].supported + ); + + return signals.map((signal, index) => ( + + {signal} + {index < signals.length - 1 && ·} + + )); + }; + + return ( + onSelect(item)}> + + + destination + + + {item.displayName} + {renderSupportedSignals()} + + + + {'Select'} + + + ); +}; + +export { DestinationListItem }; diff --git a/frontend/webapp/containers/main/destinations/add-destination/destinations-list/index.tsx b/frontend/webapp/containers/main/destinations/add-destination/destinations-list/index.tsx new file mode 100644 index 000000000..88b78bc83 --- /dev/null +++ b/frontend/webapp/containers/main/destinations/add-destination/destinations-list/index.tsx @@ -0,0 +1,77 @@ +import React from 'react'; +import styled from 'styled-components'; +import { DestinationTypeItem } from '@/types'; +import { capitalizeFirstLetter } from '@/utils'; +import { DestinationListItem } from './destination-list-item'; +import { NoDataFound, SectionTitle } from '@/reuseable-components'; +import { IDestinationListItem } from '../choose-destination-modal-body'; +import { PotentialDestinationsList } from './potential-destinations-list'; + +const Container = styled.div` + display: flex; + flex-direction: column; + align-self: stretch; + max-height: calc(100vh - 450px); + overflow-y: auto; + + @media (height < 800px) { + max-height: calc(100vh - 400px); + } +`; + +const ListsWrapper = styled.div` + display: flex; + flex-direction: column; + gap: 12px; +`; + +const NoDataFoundWrapper = styled(Container)` + margin-top: 80px; +`; + +interface DestinationsListProps { + items: IDestinationListItem[]; + setSelectedItems: (item: DestinationTypeItem) => void; +} + +const DestinationsList: React.FC = ({ + items, + setSelectedItems, +}) => { + function renderCategoriesList() { + if (!items.length) { + return ( + + + + ); + } + + return items.map((item) => { + return ( + + + {item.items.map((categoryItem) => ( + + ))} + + ); + }); + } + + return ( + + + {renderCategoriesList()} + + ); +}; + +export { DestinationsList }; diff --git a/frontend/webapp/containers/main/destinations/add-destination/destinations-list/potential-destinations-list/index.tsx b/frontend/webapp/containers/main/destinations/add-destination/destinations-list/potential-destinations-list/index.tsx new file mode 100644 index 000000000..8470f2e81 --- /dev/null +++ b/frontend/webapp/containers/main/destinations/add-destination/destinations-list/potential-destinations-list/index.tsx @@ -0,0 +1,50 @@ +import React from 'react'; +import styled from 'styled-components'; +import { DestinationTypeItem } from '@/types'; +import { usePotentialDestinations } from '@/hooks'; +import { DestinationListItem } from '../destination-list-item'; +import { SectionTitle, SkeletonLoader } from '@/reuseable-components'; + +const ListsWrapper = styled.div` + display: flex; + flex-direction: column; + gap: 12px; +`; + +interface PotentialDestinationsListProps { + setSelectedItems: (item: DestinationTypeItem) => void; +} + +const PotentialDestinationsList: React.FC = ({ + setSelectedItems, +}) => { + const { loading, data } = usePotentialDestinations(); + + if (!data.length) { + return null; + } + + return ( + + + {loading ? ( + + ) : ( + data.map((item) => ( + + )) + )} + + ); +}; + +export { PotentialDestinationsList }; diff --git a/frontend/webapp/containers/main/destinations/add-destination/dynamic-form-fields/index.tsx b/frontend/webapp/containers/main/destinations/add-destination/dynamic-form-fields/index.tsx new file mode 100644 index 000000000..5c6ae04ca --- /dev/null +++ b/frontend/webapp/containers/main/destinations/add-destination/dynamic-form-fields/index.tsx @@ -0,0 +1,70 @@ +import React from 'react'; +import { INPUT_TYPES } from '@/utils'; +import { + Dropdown, + Input, + TextArea, + InputList, + KeyValueInputsList, +} from '@/reuseable-components'; + +export function DynamicConnectDestinationFormFields({ + fields, + onChange, +}: { + fields: any[]; + onChange: (name: string, value: any) => void; +}) { + return fields?.map((field: any) => { + switch (field.componentType) { + case INPUT_TYPES.INPUT: + return ( + onChange(field.name, e.target.value)} + /> + ); + + case INPUT_TYPES.DROPDOWN: + return ( + + onChange(field.name, { id: option.id, value: option.value }) + } + /> + ); + case INPUT_TYPES.MULTI_INPUT: + return ( + + onChange(field.name, JSON.stringify(value)) + } + /> + ); + + case INPUT_TYPES.KEY_VALUE_PAIR: + return ( + onChange(field.name, JSON.stringify(value))} + /> + ); + case INPUT_TYPES.TEXTAREA: + return ( +