Skip to content

Commit

Permalink
move hypercloud enterprise components into seperate package
Browse files Browse the repository at this point in the history
  • Loading branch information
rockwotj committed Aug 29, 2024
1 parent 6763fda commit 8f52096
Show file tree
Hide file tree
Showing 6 changed files with 37 additions and 7 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -18,6 +18,7 @@ import (
bedrocktypes "github.com/aws/aws-sdk-go-v2/service/bedrockruntime/types"
"github.com/redpanda-data/benthos/v4/public/service"

"github.com/redpanda-data/connect/v4/internal/impl/aws"
"github.com/redpanda-data/connect/v4/internal/impl/aws/config"
)

Expand Down Expand Up @@ -75,7 +76,7 @@ For more information, see the https://docs.aws.amazon.com/bedrock/latest/usergui
}

func newBedrockProcessor(conf *service.ParsedConfig, mgr *service.Resources) (service.Processor, error) {
aconf, err := GetSession(context.Background(), conf)
aconf, err := aws.GetSession(context.Background(), conf)
if err != nil {
return nil, err
}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -130,15 +130,12 @@ func newVertexAIProcessor(conf *service.ParsedConfig, mgr *service.Resources) (p
}
opts := []option.ClientOption{}
if conf.Contains(vaipFieldCredentialsJSON) {
var jsonFile string
jsonFile, err = conf.FieldString(vaipFieldCredentialsJSON)
if err != nil {
return
}
opts, err = getClientOptionWithCredential(jsonFile, opts)
var jsonObject string
jsonObject, err = conf.FieldString(vaipFieldCredentialsJSON)
if err != nil {
return
}
opts = append(opts, option.WithCredentialsJSON([]byte(jsonObject)))
}
proc.client, err = genai.NewClient(ctx, project, location, opts...)
if err != nil {
Expand Down
2 changes: 2 additions & 0 deletions public/components/all/package.go
Original file line number Diff line number Diff line change
Expand Up @@ -23,6 +23,8 @@ import (
_ "github.com/redpanda-data/connect/v4/public/components/community"

// Import all enterprise components.
_ "github.com/redpanda-data/connect/v4/public/components/aws/enterprise"
_ "github.com/redpanda-data/connect/v4/public/components/gcp/enterprise"
_ "github.com/redpanda-data/connect/v4/public/components/ollama"
_ "github.com/redpanda-data/connect/v4/public/components/openai"
_ "github.com/redpanda-data/connect/v4/public/components/snowflake"
Expand Down
14 changes: 14 additions & 0 deletions public/components/aws/enterprise/package.go
Original file line number Diff line number Diff line change
@@ -0,0 +1,14 @@
// Copyright 2024 Redpanda Data, Inc.
//
// Licensed as a Redpanda Enterprise file under the Redpanda Community
// License (the "License"); you may not use this file except in compliance with
// the License. You may obtain a copy of the License at
//
// https://github.com/redpanda-data/redpanda/blob/master/licenses/rcl.md

package enterprise

import (
// Bring in the internal plugin definitions.
_ "github.com/redpanda-data/connect/v4/internal/impl/aws/enterprise"
)
2 changes: 2 additions & 0 deletions public/components/cloud/package.go
Original file line number Diff line number Diff line change
Expand Up @@ -20,9 +20,11 @@ import (
// Only import a subset of components for execution.
_ "github.com/redpanda-data/connect/v4/public/components/amqp09"
_ "github.com/redpanda-data/connect/v4/public/components/aws"
_ "github.com/redpanda-data/connect/v4/public/components/aws/enterprise"
_ "github.com/redpanda-data/connect/v4/public/components/changelog"
_ "github.com/redpanda-data/connect/v4/public/components/confluent"
_ "github.com/redpanda-data/connect/v4/public/components/crypto"
_ "github.com/redpanda-data/connect/v4/public/components/gcp/enterprise"
_ "github.com/redpanda-data/connect/v4/public/components/io"
_ "github.com/redpanda-data/connect/v4/public/components/kafka"
_ "github.com/redpanda-data/connect/v4/public/components/maxmind"
Expand Down
14 changes: 14 additions & 0 deletions public/components/gcp/enterprise/package.go
Original file line number Diff line number Diff line change
@@ -0,0 +1,14 @@
// Copyright 2024 Redpanda Data, Inc.
//
// Licensed as a Redpanda Enterprise file under the Redpanda Community
// License (the "License"); you may not use this file except in compliance with
// the License. You may obtain a copy of the License at
//
// https://github.com/redpanda-data/redpanda/blob/master/licenses/rcl.md

package gcp

import (
// Bring in the internal plugin definitions.
_ "github.com/redpanda-data/connect/v4/internal/impl/gcp/enterprise"
)

0 comments on commit 8f52096

Please sign in to comment.