Skip to content
Merged
Show file tree
Hide file tree
Changes from 15 commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
4 changes: 2 additions & 2 deletions Makefile
Original file line number Diff line number Diff line change
Expand Up @@ -2,8 +2,7 @@ VERSION=$(shell git describe --tags --dirty --always)

.PHONY: build
build:
sed -i '/specification:/,/version:/ s/version: .*/version: '"${VERSION}"'/' connector.yaml
go build -o conduit-connector-connectorname cmd/connector/main.go
go build -ldflags "-X 'github.com/conduitio/conduit-connector-connectorname.version=${VERSION}'" -o conduit-connector-connectorname cmd/connector/main.go

.PHONY: test
test:
Expand All @@ -20,6 +19,7 @@ test-integration:
.PHONY: generate
generate:
go generate ./...
conn-sdk-cli readmegen -w

.PHONY: install-tools
install-tools:
Expand Down
1 change: 1 addition & 0 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -23,6 +23,7 @@ of seconds.
git commit -m "initialize repository"
```
5. Set up [automatic Dependabot PR merges](#automatically-merging-dependabot-prs).
6. Run `make install-tools` to install the tooling needed.

With that, you're all set up and ready to start working on your connector! As a
next step, we recommend that you check out
Expand Down
29 changes: 18 additions & 11 deletions README_TEMPLATE.md
Original file line number Diff line number Diff line change
@@ -1,10 +1,9 @@
# Conduit Connector for <resource>
# Conduit Connector for <!-- readmegen:name --> <resource> <!-- /readmegen:name -->

[Conduit](https://conduit.io) connector for <resource>.
[Conduit](https://conduit.io) connector for <!-- readmegen:name --> <resource> <!-- /readmegen:name -->.

## How to build?

Run `make build` to build the connector.
<!-- readmegen:description -->
<!-- /readmegen:description -->

## Source

Expand All @@ -13,9 +12,8 @@ downstream resources via Conduit.

### Configuration

| name | description | required | default value |
|-----------------------|---------------------------------------|----------|---------------|
| `source_config_param` | Description of `source_config_param`. | true | 1000 |
<!-- readmegen:source.parameters.yaml -->
<!-- /readmegen:source.parameters.yaml -->

## Destination

Expand All @@ -24,9 +22,18 @@ resource via Conduit.

### Configuration

| name | description | required | default value |
|----------------------------|--------------------------------------------|----------|---------------|
| `destination_config_param` | Description of `destination_config_param`. | true | 1000 |
<!-- readmegen:destination.parameters.yaml -->
<!-- /readmegen:destination.parameters.yaml -->

## Development

- To install the required tools, run `make install-tools`.
- To generate code (mocks, re-generate `connector.yaml`, update the README,
etc.), run `make generate`.

## How to build?

Run `make build` to build the connector.

## Testing

Expand Down
6 changes: 4 additions & 2 deletions connector.go
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
//go:generate specgen
//go:generate conn-sdk-cli specgen

package connectorname

Expand All @@ -11,8 +11,10 @@ import (
//go:embed connector.yaml
var specs string

var version = "(devel)"

var Connector = sdk.Connector{
NewSpecification: sdk.YAMLSpecification(specs),
NewSpecification: sdk.YAMLSpecification(specs, version),
NewSource: NewSource,
NewDestination: NewDestination,
}
33 changes: 19 additions & 14 deletions connector.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,12 @@ version: "1.0"
specification:
name: connectorname
summary: A brief description of your connector.
description: A detailed description of your connector.
description: |-
This is a detailed description of your connector.

It can contain information about the features and limitations of the connector, usage instructions, etc.

By default, it's inserted into the README file and Markdown syntax can be used.
version: v0.0.1
author: Your Name
source:
Expand All @@ -16,6 +21,13 @@ specification:
validations:
- type: required
value: ""
- name: sourceConfigParam
description: SourceConfigParam must be provided by the user.
type: string
default: ""
validations:
- type: required
value: ""
- name: sdk.batch.delay
description: Maximum delay before an incomplete batch is read from the source.
type: duration
Expand Down Expand Up @@ -78,31 +90,24 @@ specification:
validations:
- type: inclusion
value: avro
- name: sourceConfigParam
description: SourceConfigParam must be provided by the user.
destination:
parameters:
- name: global_config_param_name
description: |-
GlobalConfigParam is named global_config_param_name and needs to be
provided by the user.
type: string
default: ""
validations:
- type: required
value: ""
destination:
parameters:
- name: destinationConfigParam
description: DestinationConfigParam must be either yes or no (defaults to yes).
type: string
default: "yes"
validations:
- type: inclusion
value: yes,no
- name: global_config_param_name
description: |-
GlobalConfigParam is named global_config_param_name and needs to be
provided by the user.
type: string
default: ""
validations:
- type: required
value: ""
- name: sdk.batch.delay
description: Maximum delay before an incomplete batch is written to the destination.
type: duration
Expand Down
32 changes: 16 additions & 16 deletions go.mod
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@ go 1.23.2

require (
github.com/conduitio/conduit-commons v0.5.0
github.com/conduitio/conduit-connector-sdk v0.12.1-0.20241209093924-eb970413379b
github.com/conduitio/conduit-connector-sdk v0.13.0
github.com/golangci/golangci-lint v1.63.4
github.com/matryer/is v1.4.1
mvdan.cc/gofumpt v0.7.0
Expand All @@ -24,7 +24,7 @@ require (
github.com/Djarvur/go-err113 v0.0.0-20210108212216-aea10b59be24 // indirect
github.com/GaijinEntertainment/go-exhaustruct/v3 v3.3.0 // indirect
github.com/Masterminds/goutils v1.1.1 // indirect
github.com/Masterminds/semver/v3 v3.3.0 // indirect
github.com/Masterminds/semver/v3 v3.3.1 // indirect
github.com/Masterminds/sprig/v3 v3.3.0 // indirect
github.com/OpenPeeDeeP/depguard/v2 v2.2.0 // indirect
github.com/alecthomas/go-check-sumtype v0.3.1 // indirect
Expand All @@ -49,8 +49,8 @@ require (
github.com/chavacava/garif v0.1.0 // indirect
github.com/ckaznocha/intrange v0.3.0 // indirect
github.com/conduitio/conduit-connector-protocol v0.9.0 // indirect
github.com/conduitio/evolviconf v0.0.0-20241105144321-27c16bddeb38 // indirect
github.com/conduitio/evolviconf/evolviyaml v0.0.0-20241105144803-b3ba81765197 // indirect
github.com/conduitio/evolviconf v0.1.0 // indirect
github.com/conduitio/evolviconf/evolviyaml v0.1.0 // indirect
github.com/conduitio/yaml/v3 v3.3.0 // indirect
github.com/curioswitch/go-reassign v0.3.0 // indirect
github.com/daixiang0/gci v0.13.5 // indirect
Expand All @@ -74,7 +74,7 @@ require (
github.com/go-viper/mapstructure/v2 v2.2.1 // indirect
github.com/go-xmlfmt/xmlfmt v1.1.3 // indirect
github.com/gobwas/glob v0.2.3 // indirect
github.com/goccy/go-json v0.10.3 // indirect
github.com/goccy/go-json v0.10.5 // indirect
github.com/gofrs/flock v0.12.1 // indirect
github.com/golang/protobuf v1.5.4 // indirect
github.com/golangci/dupl v0.0.0-20180902072040-3e9179ac440a // indirect
Expand Down Expand Up @@ -164,9 +164,9 @@ require (
github.com/ryanrolds/sqlclosecheck v0.5.1 // indirect
github.com/sagikazarmark/locafero v0.6.0 // indirect
github.com/sagikazarmark/slog-shim v0.1.0 // indirect
github.com/samber/lo v1.44.0 // indirect
github.com/samber/slog-common v0.17.0 // indirect
github.com/samber/slog-zerolog/v2 v2.7.0 // indirect
github.com/samber/lo v1.47.0 // indirect
github.com/samber/slog-common v0.18.1 // indirect
github.com/samber/slog-zerolog/v2 v2.7.3 // indirect
github.com/sanposhiho/wastedassign/v2 v2.1.0 // indirect
github.com/santhosh-tekuri/jsonschema/v6 v6.0.1 // indirect
github.com/sashamelentyev/interfacebloat v1.1.0 // indirect
Expand Down Expand Up @@ -213,19 +213,19 @@ require (
go.uber.org/mock v0.5.0 // indirect
go.uber.org/multierr v1.11.0 // indirect
go.uber.org/zap v1.27.0 // indirect
golang.org/x/crypto v0.30.0 // indirect
golang.org/x/crypto v0.32.0 // indirect
golang.org/x/exp v0.0.0-20241009180824-f66d83c29e7c // indirect
golang.org/x/exp/typeparams v0.0.0-20241108190413-2d47ceb2692f // indirect
golang.org/x/mod v0.22.0 // indirect
golang.org/x/net v0.32.0 // indirect
golang.org/x/net v0.34.0 // indirect
golang.org/x/sync v0.10.0 // indirect
golang.org/x/sys v0.28.0 // indirect
golang.org/x/sys v0.29.0 // indirect
golang.org/x/text v0.21.0 // indirect
golang.org/x/time v0.8.0 // indirect
golang.org/x/tools v0.28.0 // indirect
google.golang.org/genproto/googleapis/rpc v0.0.0-20240930140551-af27646dc61f // indirect
google.golang.org/grpc v1.68.1 // indirect
google.golang.org/protobuf v1.35.1 // indirect
golang.org/x/time v0.9.0 // indirect
golang.org/x/tools v0.29.0 // indirect
google.golang.org/genproto/googleapis/rpc v0.0.0-20241202173237-19429a94021a // indirect
google.golang.org/grpc v1.70.0 // indirect
google.golang.org/protobuf v1.35.2 // indirect
gopkg.in/ini.v1 v1.67.0 // indirect
gopkg.in/tomb.v2 v2.0.0-20161208151619-d5d1b5820637 // indirect
gopkg.in/yaml.v2 v2.4.0 // indirect
Expand Down
Loading