Skip to content

Commit

Permalink
feat: remove kafka package from utils
Browse files Browse the repository at this point in the history
  • Loading branch information
Mahanmmi committed Jan 9, 2024
1 parent 12f6072 commit 9bbc473
Show file tree
Hide file tree
Showing 5 changed files with 24 additions and 323 deletions.
22 changes: 22 additions & 0 deletions pkg/es/doc.go
Original file line number Diff line number Diff line change
@@ -0,0 +1,22 @@
package es

import (
"crypto/sha256"
"fmt"
)

const (
EsIndexHeader = "elasticsearch_index"
)

type Doc interface {
KeysAndIndex() ([]string, string)
}

func HashOf(strings ...string) string {
h := sha256.New()
for _, s := range strings {
h.Write([]byte(s))
}
return fmt.Sprintf("%x", h.Sum(nil))
}
78 changes: 0 additions & 78 deletions pkg/kafka/consume.go

This file was deleted.

30 changes: 0 additions & 30 deletions pkg/kafka/producer.go

This file was deleted.

212 changes: 0 additions & 212 deletions pkg/kafka/sender.go

This file was deleted.

5 changes: 2 additions & 3 deletions pkg/pipeline/sender.go
Original file line number Diff line number Diff line change
Expand Up @@ -7,14 +7,13 @@ import (
"fmt"
v4 "github.com/aws/aws-sdk-go-v2/aws/signer/v4"
"github.com/aws/aws-sdk-go-v2/config"
"github.com/kaytu-io/kaytu-util/pkg/kafka"
"io"
"net/http"
"strings"
"time"
)

func sendToPipelineIndividually(ingestionPipelineEndpoint string, resourcesToSend []kafka.Doc) error {
func sendToPipelineIndividually(ingestionPipelineEndpoint string, resourcesToSend []doc.Doc) error {

Check failure on line 16 in pkg/pipeline/sender.go

View workflow job for this annotation

GitHub Actions / test

undefined: doc
httpClient := &http.Client{Timeout: 10 * time.Second}
if len(resourcesToSend) == 0 {
return nil
Expand Down Expand Up @@ -72,7 +71,7 @@ func sendToPipelineIndividually(ingestionPipelineEndpoint string, resourcesToSen
return nil
}

func SendToPipeline(ingestionPipelineEndpoint string, resourcesToSend []kafka.Doc) error {
func SendToPipeline(ingestionPipelineEndpoint string, resourcesToSend []doc.Doc) error {

Check failure on line 74 in pkg/pipeline/sender.go

View workflow job for this annotation

GitHub Actions / test

undefined: doc
httpClient := &http.Client{Timeout: 10 * time.Second}
if len(resourcesToSend) == 0 {
return nil
Expand Down

0 comments on commit 9bbc473

Please sign in to comment.