Skip to content

Commit

Permalink
removed udl-go package
Browse files Browse the repository at this point in the history
  • Loading branch information
William-Hill committed Dec 4, 2024
1 parent 293bac9 commit bae4ce0
Show file tree
Hide file tree
Showing 8 changed files with 45,860 additions and 11 deletions.
3 changes: 1 addition & 2 deletions destination/destination.go
Original file line number Diff line number Diff line change
Expand Up @@ -20,8 +20,7 @@ import (

sdk "github.com/conduitio/conduit-connector-sdk"
"github.com/deepmap/oapi-codegen/pkg/securityprovider"

"github.com/meroxa/udl-go"
"github.com/meroxa/conduit-connector-udl-public/udl"
)

type Destination struct {
Expand Down
2 changes: 1 addition & 1 deletion destination/destination_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -22,7 +22,7 @@ import (
sdk "github.com/conduitio/conduit-connector-sdk"
"github.com/matryer/is"

"github.com/meroxa/udl-go"
"github.com/meroxa/conduit-connector-udl-public/udl"
)

type mockClient struct {
Expand Down
2 changes: 1 addition & 1 deletion destination/transform.go
Original file line number Diff line number Diff line change
Expand Up @@ -22,7 +22,7 @@ import (
"time"

sdk "github.com/conduitio/conduit-connector-sdk"
"github.com/meroxa/udl-go"
"github.com/meroxa/conduit-connector-udl-public/udl"
)

var spireToNavcenShipTypeMapping = map[string]string{
Expand Down
6 changes: 2 additions & 4 deletions destination/udlWriter.go
Original file line number Diff line number Diff line change
Expand Up @@ -16,14 +16,12 @@ package destination

import (
"context"
"errors"

sdk "github.com/conduitio/conduit-connector-sdk"
"github.com/meroxa/conduit-connector-udl-public/udl"

"fmt"
"strings"

"github.com/meroxa/udl-go"
)

func OpenCDCPayload(rawPayload map[string]interface{}) string {
Expand Down Expand Up @@ -62,7 +60,7 @@ func (d *Destination) writeEphemerisToUDL(ctx context.Context, records []sdk.Rec
sdk.Logger(context.Background()).Info().Msgf("Submitted Ephemeris Request Parameters - IdOnOrbit: %s, Classification: %s, DataMode: %s, HasMnvr: %t, Type: %s, Category: %s, EphemFormatType: %s, Source: %s", params.IdOnOrbit, params.Classification, params.DataMode, params.HasMnvr, params.Type, params.Category, params.EphemFormatType, params.Source)

if response.StatusCode > 300 {
return 0, errors.New(fmt.Sprintf("unsuccessful status code returned %d; response: %+v", response.StatusCode, response.Body))
return 0, fmt.Errorf(fmt.Sprintf("unsuccessful status code returned %d; response: %+v", response.StatusCode, response.Body))
}

sdk.Logger(context.Background()).Info().Msgf("Spire to Ephemeris UDL response: %+v:", response)
Expand Down
1 change: 0 additions & 1 deletion go.mod
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,6 @@ require (
github.com/conduitio/conduit-connector-sdk v0.7.2
github.com/deepmap/oapi-codegen v1.12.4
github.com/matryer/is v1.4.1
github.com/meroxa/udl-go v0.0.0-20230411154317-11b5221c27aa
)

require (
Expand Down
2 changes: 0 additions & 2 deletions go.sum
Original file line number Diff line number Diff line change
Expand Up @@ -62,8 +62,6 @@ github.com/mattn/go-isatty v0.0.14/go.mod h1:7GGIvUiUoEMVVmxf/4nioHXj79iQHKdU27k
github.com/mattn/go-isatty v0.0.16/go.mod h1:kYGgaQfpe5nmfYZH+SKPsOc2e4SrIfOl2e/yFXSvRLM=
github.com/mattn/go-isatty v0.0.18 h1:DOKFKCQ7FNG2L1rbrmstDN4QVRdS89Nkh85u68Uwp98=
github.com/mattn/go-isatty v0.0.18/go.mod h1:W+V8PltTTMOvKvAeJH7IuucS94S2C6jfK/D7dTCTo3Y=
github.com/meroxa/udl-go v0.0.0-20230411154317-11b5221c27aa h1:DEwqmAdTh9tzaGScT7lBHRVW5wVTo/aRR+pfFP7auPQ=
github.com/meroxa/udl-go v0.0.0-20230411154317-11b5221c27aa/go.mod h1:brp/uKZfZAcIw5zoxzFzftauiwM8me2z1f/rZz8XLF4=
github.com/mitchellh/copystructure v1.0.0/go.mod h1:SNtv71yrdKgLRyLFxmLdkAbkKEFWgYaq1OVrnRcwhnw=
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=
Expand Down
15 changes: 15 additions & 0 deletions udl/client.go
Original file line number Diff line number Diff line change
@@ -0,0 +1,15 @@
package udl

import "github.com/deepmap/oapi-codegen/pkg/securityprovider"

func NewClientWithBasicAuth(url, username, password string) (*Client, error) {
authProvider, err := generateBasicAuth(username, password)
if err != nil {
return nil, err
}
return NewClient(url, WithRequestEditorFn(authProvider.Intercept))
}

func generateBasicAuth(username, password string) (*securityprovider.SecurityProviderBasicAuth, error) {
return securityprovider.NewSecurityProviderBasicAuth(username, password)
}
Loading

0 comments on commit bae4ce0

Please sign in to comment.