Skip to content

Commit

Permalink
Merge pull request #310 from blumamir/destanations
Browse files Browse the repository at this point in the history
feat: destinations and destination types
  • Loading branch information
blumamir authored Jul 18, 2023
2 parents d5d5d56 + 940d545 commit de9e2af
Show file tree
Hide file tree
Showing 8 changed files with 409 additions and 48 deletions.
4 changes: 2 additions & 2 deletions frontend/destinations/data/chronosphere.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -14,9 +14,9 @@ spec:
logs:
supported: false
fields:
- name: collector_endpoint
- name: CHRONOSPHERE_COLLECTOR
displayName: Collector Endpoint
videoUrl: https://www.youtube.com/watch?v=9QZxw-mtZmU
componentType: input
componentProps:
type: text
type: text
5 changes: 3 additions & 2 deletions frontend/destinations/data/datadog.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -14,13 +14,14 @@ spec:
logs:
supported: true
fields:
- name: api_key
- name: DATADOG_API_KEY
displayName: API Key
videoUrl: https://www.youtube.com/watch?v=9QZxw-mtZmU
componentType: input
componentProps:
type: password
- name: site
secret: true
- name: DATADOG_SITE
displayName: Site
videoUrl: https://www.youtube.com/watch?v=9QZxw-mtZmU
componentType: dropdown
Expand Down
4 changes: 2 additions & 2 deletions frontend/destinations/data/jaeger.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -14,9 +14,9 @@ spec:
logs:
supported: false
fields:
- name: endpoint
- name: JAEGER_URL
displayName: Endpoint
videoUrl: https://www.youtube.com/watch?v=9QZxw-mtZmU
componentType: input
componentProps:
type: text
type: text
9 changes: 6 additions & 3 deletions frontend/destinations/model.go
Original file line number Diff line number Diff line change
@@ -1,5 +1,7 @@
package destinations

import "github.com/keyval-dev/odigos/common"

type Destination struct {
ApiVersion string `yaml:"apiVersion"`
Kind string `yaml:"kind"`
Expand All @@ -8,9 +10,9 @@ type Destination struct {
}

type Metadata struct {
Type string `yaml:"type"`
DisplayName string `yaml:"displayName"`
Category string `yaml:"category"`
Type common.DestinationType `yaml:"type"`
DisplayName string `yaml:"displayName"`
Category string `yaml:"category"`
}

type Spec struct {
Expand All @@ -35,4 +37,5 @@ type Field struct {
VideoURL string `yaml:"videoUrl"`
ComponentType string `yaml:"componentType"`
ComponentProps map[string]interface{} `yaml:"componentProps"`
Secret bool `yaml:"secret"`
}
10 changes: 10 additions & 0 deletions frontend/endpoints/common.go
Original file line number Diff line number Diff line change
Expand Up @@ -11,3 +11,13 @@ func returnError(c *gin.Context, err error) {
"message": err.Error(),
})
}

func returnErrors(c *gin.Context, errors []error) {
errorsText := make([]string, len(errors))
for i, err := range errors {
errorsText[i] = err.Error()
}
c.JSON(http.StatusInternalServerError, gin.H{
"messages": errorsText,
})
}
Loading

0 comments on commit de9e2af

Please sign in to comment.