From f50080505967f7a1f8f37776b928529de37c35f6 Mon Sep 17 00:00:00 2001 From: Haris Osmanagic Date: Wed, 28 Sep 2022 12:56:23 +0200 Subject: [PATCH 1/5] init --- .gitignore | 96 +----------------------------------------------------- go.mod | 16 +++++---- go.sum | 58 +++++++++++++-------------------- 3 files changed, 33 insertions(+), 137 deletions(-) diff --git a/.gitignore b/.gitignore index 19239b5..ac8eabe 100644 --- a/.gitignore +++ b/.gitignore @@ -1,6 +1,3 @@ -# Created by https://www.toptal.com/developers/gitignore/api/macos,windows,goland,visualstudiocode,go -# Edit at https://www.toptal.com/developers/gitignore?templates=macos,windows,goland,visualstudiocode,go - ### Go ### # If you prefer the allow list template instead of the deny list, see community template: # https://github.com/github/gitignore/blob/main/community/Golang/Go.AllowList.gitignore @@ -33,50 +30,11 @@ go.work # Reference: https://intellij-support.jetbrains.com/hc/en-us/articles/206544839 # User-specific stuff -.idea/**/workspace.xml -.idea/**/tasks.xml -.idea/**/usage.statistics.xml -.idea/**/dictionaries -.idea/**/shelf - -# AWS User-specific -.idea/**/aws.xml - -# Generated files -.idea/**/contentModel.xml - -# Sensitive or high-churn files -.idea/**/dataSources/ -.idea/**/dataSources.ids -.idea/**/dataSources.local.xml -.idea/**/sqlDataSources.xml -.idea/**/dynamic.xml -.idea/**/uiDesigner.xml -.idea/**/dbnavigator.xml - -# Gradle -.idea/**/gradle.xml -.idea/**/libraries - -# Gradle and Maven with auto-import -# When using Gradle or Maven with auto-import, you should exclude module files, -# since they will be recreated, and may cause churn. Uncomment if using -# auto-import. -# .idea/artifacts -# .idea/compiler.xml -# .idea/jarRepositories.xml -# .idea/modules.xml -# .idea/*.iml -# .idea/modules -# *.iml -# *.ipr +.idea/ # CMake cmake-build-*/ -# Mongo Explorer plugin -.idea/**/mongoSettings.xml - # File-based project format *.iws @@ -86,57 +44,6 @@ out/ # mpeltonen/sbt-idea plugin .idea_modules/ -# JIRA plugin -atlassian-ide-plugin.xml - -# Cursive Clojure plugin -.idea/replstate.xml - -# SonarLint plugin -.idea/sonarlint/ - -# Crashlytics plugin (for Android Studio and IntelliJ) -com_crashlytics_export_strings.xml -crashlytics.properties -crashlytics-build.properties -fabric.properties - -# Editor-based Rest Client -.idea/httpRequests - -# Android studio 3.1+ serialized cache file -.idea/caches/build_file_checksums.ser - -### GoLand Patch ### -# Comment Reason: https://github.com/joeblau/gitignore.io/issues/186#issuecomment-215987721 - -# *.iml -# modules.xml -# .idea/misc.xml -# *.ipr - -# Sonarlint plugin -# https://plugins.jetbrains.com/plugin/7973-sonarlint -.idea/**/sonarlint/ - -# SonarQube Plugin -# https://plugins.jetbrains.com/plugin/7238-sonarqube-community-plugin -.idea/**/sonarIssues.xml - -# Markdown Navigator plugin -# https://plugins.jetbrains.com/plugin/7896-markdown-navigator-enhanced -.idea/**/markdown-navigator.xml -.idea/**/markdown-navigator-enh.xml -.idea/**/markdown-navigator/ - -# Cache file creation bug -# See https://youtrack.jetbrains.com/issue/JBR-2257 -.idea/$CACHE_FILE$ - -# CodeStream plugin -# https://plugins.jetbrains.com/plugin/12206-codestream -.idea/codestream.xml - ### macOS ### # General .DS_Store @@ -146,7 +53,6 @@ fabric.properties # Icon must end with two \r Icon - # Thumbnails ._* diff --git a/go.mod b/go.mod index 6c59c7f..ed1f62a 100644 --- a/go.mod +++ b/go.mod @@ -3,15 +3,15 @@ module github.com/miquido/conduit-connector-salesforce go 1.18 require ( - github.com/conduitio/conduit-connector-sdk v0.2.1-0.20220608071937-511c321558fc + github.com/conduitio/conduit-connector-sdk v0.3.0 github.com/jaswdr/faker v1.12.1 github.com/stretchr/testify v1.8.0 - golang.org/x/net v0.0.0-20220531201128-c960675eff93 + golang.org/x/net v0.0.0-20220722155237-a158d28d115b gopkg.in/tomb.v2 v2.0.0-20161208151619-d5d1b5820637 ) require ( - github.com/conduitio/conduit-connector-protocol v0.2.0 // indirect + github.com/conduitio/conduit-connector-protocol v0.3.0 // indirect github.com/davecgh/go-spew v1.1.1 // indirect github.com/fatih/color v1.13.0 // indirect github.com/golang/protobuf v1.5.2 // indirect @@ -19,17 +19,19 @@ require ( github.com/hashicorp/go-plugin v1.4.4 // indirect github.com/hashicorp/yamux v0.0.0-20211028200310-0bc27b27de87 // indirect github.com/jpillora/backoff v1.0.0 // indirect + github.com/kr/text v0.2.0 // indirect github.com/matryer/is v1.4.0 // indirect github.com/mattn/go-colorable v0.1.12 // indirect github.com/mattn/go-isatty v0.0.14 // indirect github.com/mitchellh/go-testing-interface v1.14.1 // indirect github.com/oklog/run v1.1.0 // indirect github.com/pmezard/go-difflib v1.0.0 // indirect - github.com/rs/zerolog v1.27.0 // indirect - go.buf.build/library/go-grpc/conduitio/conduit-connector-protocol v1.4.1 // indirect - go.uber.org/goleak v1.1.12 // indirect - golang.org/x/sys v0.0.0-20220520151302-bc2c85ada10a // indirect + github.com/rs/zerolog v1.28.0 // indirect + go.buf.build/grpc/go/conduitio/conduit-connector-protocol v1.3.3 // indirect + go.uber.org/goleak v1.2.0 // indirect + golang.org/x/sys v0.0.0-20220926163933-8cfa568d3c25 // indirect golang.org/x/text v0.3.7 // indirect + golang.org/x/time v0.0.0-20220722155302-e5dcc9cfc0b9 // indirect google.golang.org/genproto v0.0.0-20220601144221-27df5f98adab // indirect google.golang.org/grpc v1.47.0 // indirect google.golang.org/protobuf v1.28.0 // indirect diff --git a/go.sum b/go.sum index cdd9f61..fefddf5 100644 --- a/go.sum +++ b/go.sum @@ -8,15 +8,15 @@ github.com/client9/misspell v0.3.4/go.mod h1:qj6jICC3Q7zFZvVWo7KLAzC3yx5G7kyvSDk github.com/cncf/udpa/go v0.0.0-20191209042840-269d4d468f6f/go.mod h1:M8M6+tZqaGXZJjfX53e64911xZQV5JYwmTeXPW+k8Sc= github.com/cncf/udpa/go v0.0.0-20201120205902-5459f2c99403/go.mod h1:WmhPx2Nbnhtbo57+VJT5O0JRkEi1Wbu0z5j0R8u5Hbk= github.com/cncf/udpa/go v0.0.0-20210930031921-04548b0d99d4/go.mod h1:6pvJx4me5XPnfI9Z40ddWsdw2W/uZgQLFXToKeRcDiI= -github.com/cncf/xds/go v0.0.0-20210312221358-fbca930ec8ed/go.mod h1:eXthEFrGJvWHgFFCl3hGmgk+/aYT6PnTQLykKQRLhEs= github.com/cncf/xds/go v0.0.0-20210922020428-25de7278fc84/go.mod h1:eXthEFrGJvWHgFFCl3hGmgk+/aYT6PnTQLykKQRLhEs= github.com/cncf/xds/go v0.0.0-20211001041855-01bcc9b48dfe/go.mod h1:eXthEFrGJvWHgFFCl3hGmgk+/aYT6PnTQLykKQRLhEs= github.com/cncf/xds/go v0.0.0-20211011173535-cb28da3451f1/go.mod h1:eXthEFrGJvWHgFFCl3hGmgk+/aYT6PnTQLykKQRLhEs= -github.com/conduitio/conduit-connector-protocol v0.2.0 h1:gwYXVKEMgTtU67ephQ5WwTGIDbT/eTLA9Mdr9Bnbqxc= -github.com/conduitio/conduit-connector-protocol v0.2.0/go.mod h1:udCU2AkLcYQoLjAO06tHVL2iFJPw+DamK+wllnj50hk= -github.com/conduitio/conduit-connector-sdk v0.2.1-0.20220608071937-511c321558fc h1:OIOPxzthWycx2JdMfW6r7AMTXmQHvLHBTH285ZkVb+8= -github.com/conduitio/conduit-connector-sdk v0.2.1-0.20220608071937-511c321558fc/go.mod h1:iz8Hbw5NjAHAAEL6lOKKg6+2EYSmYwZtcDQv1iqP8RM= +github.com/conduitio/conduit-connector-protocol v0.3.0 h1:Ix0C1jMQ23diRzfSfxWG9RJDHVc7Vu0yCVjKa25Y0SU= +github.com/conduitio/conduit-connector-protocol v0.3.0/go.mod h1:jynMd6Kuc7xUABrvYTUrOBuTYAtoQsZ7T6tAB9xAWOo= +github.com/conduitio/conduit-connector-sdk v0.3.0 h1:EC0iXfC9+CHG5jVuks8ilQ5k2uL6awYJ6szJ3pRah80= +github.com/conduitio/conduit-connector-sdk v0.3.0/go.mod h1:M8UWBoTPBoTY7SDu6ku95TGAipu3mJ43LlYgfM/ciwg= github.com/coreos/go-systemd/v22 v22.3.3-0.20220203105225-a9a7ef127534/go.mod h1:Y58oyj3AT4RCenI/lSvhwexgC+NSVTIJ3seZv2GcEnc= +github.com/creack/pty v1.1.9/go.mod h1:oKZEueFk5CKHvIhNR5MUki03XCEU+Q6VDXinZuGJ33E= github.com/davecgh/go-spew v1.1.0/go.mod h1:J7Y8YcW2NihsgmVo/mv3lAwl/skON4iLHjSsI+c5H38= github.com/davecgh/go-spew v1.1.1 h1:vj9j/u1bqnvCEfJOwUhtlOARqs3+rkHYY13jYWTU97c= github.com/davecgh/go-spew v1.1.1/go.mod h1:J7Y8YcW2NihsgmVo/mv3lAwl/skON4iLHjSsI+c5H38= @@ -24,7 +24,6 @@ github.com/envoyproxy/go-control-plane v0.9.0/go.mod h1:YTl/9mNaCwkRvm6d1a2C3ymF github.com/envoyproxy/go-control-plane v0.9.1-0.20191026205805-5f8ba28d4473/go.mod h1:YTl/9mNaCwkRvm6d1a2C3ymFceY/DCBVvsKhRF0iEA4= github.com/envoyproxy/go-control-plane v0.9.4/go.mod h1:6rpuAdCZL397s3pYoYcLgu1mIlRU8Am5FuJP05cCM98= github.com/envoyproxy/go-control-plane v0.9.9-0.20201210154907-fd9021fe5dad/go.mod h1:cXg6YxExXjJnVBQHBLXeUAgxn2UodCpnH306RInaBQk= -github.com/envoyproxy/go-control-plane v0.9.9-0.20210512163311-63b5d3c536b0/go.mod h1:hliV/p42l8fGbc6Y9bQ70uLwIvmJyVE5k4iMKlh8wCQ= github.com/envoyproxy/go-control-plane v0.10.2-0.20220325020618-49ff273808a1/go.mod h1:KJwIaB5Mv44NWtYuAOFCVOjcI94vtpEz2JU/D2v6IjE= github.com/envoyproxy/protoc-gen-validate v0.1.0/go.mod h1:iSmxcyjqTsJpI2R4NaDN7+kN2VEUnK/pcBlmesArF7c= github.com/fatih/color v1.7.0/go.mod h1:Zm6kSWBoL9eyXnKyktHP6abPY2pDugNf5KwzbycvMj4= @@ -71,10 +70,8 @@ github.com/jhump/protoreflect v1.10.2-0.20211108190630-d551e22cd340 h1:Vdzuzjwa0 github.com/jpillora/backoff v1.0.0 h1:uvFg412JmmHBHw7iwprIxkPMI+sGQ4kzOWsMeHnm2EA= github.com/jpillora/backoff v1.0.0/go.mod h1:J/6gKK9jxlEcS3zixgDgUAsiuZ7yrSoa/FX5e0EB2j4= github.com/kr/pretty v0.1.0 h1:L/CwN0zerZDmRFUapSPitk6f+Q3+0za1rQkzVuMiMFI= -github.com/kr/pretty v0.1.0/go.mod h1:dAy3ld7l9f0ibDNOQOHHMYYIIbhfbHSm3C4ZsoJORNo= -github.com/kr/pty v1.1.1/go.mod h1:pFQYn66WHrOpPYNljwOMqo10TkYh1fy3cYio2l3bCsQ= -github.com/kr/text v0.1.0 h1:45sCR5RtlFHMR4UwH9sdQ5TC8v0qDQCHnXt+kaKSTVE= -github.com/kr/text v0.1.0/go.mod h1:4Jbv+DJW3UT/LiOwJeYQe1efqtUx/iVham/4vfdArNI= +github.com/kr/text v0.2.0 h1:5Nx0Ya0ZqY2ygV366QzturHI13Jq95ApcVaJBhpS+AY= +github.com/kr/text v0.2.0/go.mod h1:eLer722TekiGuMkidMxC/pM04lWEeraHUUmBw8l2grE= github.com/matryer/is v1.4.0 h1:sosSmIWwkYITGrxZ25ULNDeKiMNzFSr4V/eqBQP0PeE= github.com/matryer/is v1.4.0/go.mod h1:8I/i5uYgLzgsgEloJE1U6xx5HkBQpAZvepWuujKwMRU= github.com/mattn/go-colorable v0.1.4/go.mod h1:U0ppj6V5qS13XJ6of8GYAs25YV2eR4EVcfRqFIhoBtE= @@ -95,9 +92,9 @@ github.com/pmezard/go-difflib v1.0.0 h1:4DBwDE0NGyQoBHbLQYPwSUPoCMWR5BEzIk/f1lZb github.com/pmezard/go-difflib v1.0.0/go.mod h1:iKH77koFhYxTK1pcRnkKkqfTogsbg7gZNVY4sRDYZ/4= github.com/prometheus/client_model v0.0.0-20190812154241-14fe0d1b01d4/go.mod h1:xMI15A0UPsDsEKsMN9yxemIoYk6Tm2C1GtYGdfGttqA= github.com/rogpeppe/fastuuid v1.2.0/go.mod h1:jVj6XXZzXRy/MSR5jhDC/2q6DgLz+nrA6LYCDYWNEvQ= -github.com/rs/xid v1.3.0/go.mod h1:trrq9SKmegXys3aeAKXMUTdJsYXVwGY3RLcfgqegfbg= -github.com/rs/zerolog v1.27.0 h1:1T7qCieN22GVc8S4Q2yuexzBb1EqjbgjSH9RohbMjKs= -github.com/rs/zerolog v1.27.0/go.mod h1:7frBqO0oezxmnO7GF86FY++uy8I0Tk/If5ni1G9Qc0U= +github.com/rs/xid v1.4.0/go.mod h1:trrq9SKmegXys3aeAKXMUTdJsYXVwGY3RLcfgqegfbg= +github.com/rs/zerolog v1.28.0 h1:MirSo27VyNi7RJYP3078AA1+Cyzd2GB66qy3aUHvsWY= +github.com/rs/zerolog v1.28.0/go.mod h1:NILgTygv/Uej1ra5XxGf82ZFSLk58MFGAUS2o6usyD0= github.com/stretchr/objx v0.1.0/go.mod h1:HFkY916IF+rwdDfMAkV7OtwuqBVzrE8GR6GFx+wExME= github.com/stretchr/objx v0.4.0/go.mod h1:YvHI0jy2hoMjB+UWwv71VJQ9isScKT/TqJzVSSt89Yw= github.com/stretchr/testify v1.2.2/go.mod h1:a8OnRcib4nhh0OaRAV+Yts87kKdq0PP7pXfy6kDkUVs= @@ -106,41 +103,35 @@ github.com/stretchr/testify v1.7.0/go.mod h1:6Fq8oRcR53rry900zMqJjRRixrwX3KX962/ github.com/stretchr/testify v1.7.1/go.mod h1:6Fq8oRcR53rry900zMqJjRRixrwX3KX962/h/Wwjteg= github.com/stretchr/testify v1.8.0 h1:pSgiaMZlXftHpm5L7V1+rVB+AZJydKsMxsQBIJw4PKk= github.com/stretchr/testify v1.8.0/go.mod h1:yNjHg4UonilssWZ8iaSj1OCr/vHnekPRkoO+kdMU+MU= -github.com/yuin/goldmark v1.3.5/go.mod h1:mwnBkeHKe2W/ZEtQ+71ViKU8L12m81fl3OWwC1Zlc8k= -go.buf.build/library/go-grpc/conduitio/conduit-connector-protocol v1.4.1 h1:EHYFlC8XppCJX8C3TS06BC3xA6ctiowDlySWErdOaXU= -go.buf.build/library/go-grpc/conduitio/conduit-connector-protocol v1.4.1/go.mod h1:iYPhlwHzhRoPYviJbA604qT6wYuQghfrebmXUXLKjk8= +go.buf.build/grpc/go/conduitio/conduit-connector-protocol v1.3.3 h1:Nlr9Dm1z7OoG4S1ic1yuwVU8oreR2eFofiJt5v8+zok= +go.buf.build/grpc/go/conduitio/conduit-connector-protocol v1.3.3/go.mod h1:0IIr2GMOsGd1hPPfwQMmXMXnME6jZSER4C2JS/+BrLc= go.opentelemetry.io/proto/otlp v0.7.0/go.mod h1:PqfVotwruBrMGOCsRd/89rSnXhoiJIqeYNgFYFoEGnI= -go.uber.org/goleak v1.1.12 h1:gZAh5/EyT/HQwlpkCy6wTpqfH9H8Lz8zbm3dZh+OyzA= -go.uber.org/goleak v1.1.12/go.mod h1:cwTWslyiVhfpKIDGSZEM2HlOvcqm+tG4zioyIeLoqMQ= +go.uber.org/goleak v1.2.0 h1:xqgm/S+aQvhWFTtR0XK3Jvg7z8kGV8P4X14IzwN3Eqk= +go.uber.org/goleak v1.2.0/go.mod h1:XJYK+MuIchqpmGmUSAzotztawfKvYLUIgg7guXrwVUo= golang.org/x/crypto v0.0.0-20190308221718-c2843e01d9a2/go.mod h1:djNgcEr1/C05ACkg1iLfiJU5Ep61QUkGW8qpdssI0+w= -golang.org/x/crypto v0.0.0-20191011191535-87dc89f01550/go.mod h1:yigFU9vqHzYiE8UmvKecakEJjdnWj3jj499lnFckfCI= golang.org/x/crypto v0.0.0-20200622213623-75b288015ac9/go.mod h1:LzIPMQfyMNhhGPhUkYOs5KpL4U8rLKemX1yGLhDgUto= golang.org/x/exp v0.0.0-20190121172915-509febef88a4/go.mod h1:CJ0aWSM057203Lf6IL+f9T1iT9GByDxfZKAQTCR3kQA= golang.org/x/lint v0.0.0-20181026193005-c67002cb31c3/go.mod h1:UVdnD1Gm6xHRNCYTkRU2/jEulfH38KcIWyp/GAMgvoE= golang.org/x/lint v0.0.0-20190227174305-5b3e6a55c961/go.mod h1:wehouNa3lNwaWXcvxsM5YxQ5yQlVC4a0KAMCusXpPoU= golang.org/x/lint v0.0.0-20190313153728-d0100b6bd8b3/go.mod h1:6SW0HCj/g11FgYtHlgUYUwCkIfeOF89ocIRzGO/8vkc= golang.org/x/lint v0.0.0-20190930215403-16217165b5de h1:5hukYrvBGR8/eNkX5mdUezrA6JiaEZDtJb9Ei+1LlBs= -golang.org/x/lint v0.0.0-20190930215403-16217165b5de/go.mod h1:6SW0HCj/g11FgYtHlgUYUwCkIfeOF89ocIRzGO/8vkc= -golang.org/x/mod v0.4.2/go.mod h1:s0Qsj1ACt9ePp/hMypM3fl4fZqREWJwdYDEqhRiZZUA= golang.org/x/net v0.0.0-20180724234803-3673e40ba225/go.mod h1:mL1N/T3taQHkDXs73rZJwtUhF3w3ftmwwsq0BUmARs4= golang.org/x/net v0.0.0-20180826012351-8a410e7b638d/go.mod h1:mL1N/T3taQHkDXs73rZJwtUhF3w3ftmwwsq0BUmARs4= golang.org/x/net v0.0.0-20190108225652-1e06a53dbb7e/go.mod h1:mL1N/T3taQHkDXs73rZJwtUhF3w3ftmwwsq0BUmARs4= golang.org/x/net v0.0.0-20190213061140-3a22650c66bd/go.mod h1:mL1N/T3taQHkDXs73rZJwtUhF3w3ftmwwsq0BUmARs4= golang.org/x/net v0.0.0-20190311183353-d8887717615a/go.mod h1:t9HGtf8HONx5eT2rtn7q6eTqICYqUVnKs3thJo3Qplg= golang.org/x/net v0.0.0-20190404232315-eb5bcb51f2a3/go.mod h1:t9HGtf8HONx5eT2rtn7q6eTqICYqUVnKs3thJo3Qplg= -golang.org/x/net v0.0.0-20190620200207-3b0461eec859/go.mod h1:z5CRVTTTmAJ677TzLLGU+0bjPO0LkuOLi4/5GtJWs/s= golang.org/x/net v0.0.0-20200822124328-c89045814202/go.mod h1:/O7V0waA8r7cgGh81Ro3o1hOxt32SMVPicZroKQ2sZA= golang.org/x/net v0.0.0-20201021035429-f5854403a974/go.mod h1:sp8m0HH+o8qH0wwXwYZr8TS3Oi6o0r6Gce1SSxlDquU= golang.org/x/net v0.0.0-20210405180319-a5a99cb37ef4/go.mod h1:p54w0d4576C0XHj96bSt6lcn1PtDYWL6XObtHCRCNQM= -golang.org/x/net v0.0.0-20220531201128-c960675eff93 h1:MYimHLfoXEpOhqd/zgoA/uoXzHB86AEky4LAx5ij9xA= -golang.org/x/net v0.0.0-20220531201128-c960675eff93/go.mod h1:XRhObCWvk6IyKnWLug+ECip1KBveYUHfp+8e9klMJ9c= +golang.org/x/net v0.0.0-20220722155237-a158d28d115b h1:PxfKdU9lEEDYjdIzOtC4qFWgkU2rGHdKlKowJSMN9h0= +golang.org/x/net v0.0.0-20220722155237-a158d28d115b/go.mod h1:XRhObCWvk6IyKnWLug+ECip1KBveYUHfp+8e9klMJ9c= golang.org/x/oauth2 v0.0.0-20180821212333-d2e6202438be/go.mod h1:N/0e6XlmueqKjAGxoOufVs8QHGRruUQn6yWY3a++T0U= golang.org/x/oauth2 v0.0.0-20200107190931-bf48bf16ab8d/go.mod h1:gOpvHmFTYa4IltrdGE7lF6nIHvwfUNPOp7c8zoXwtLw= golang.org/x/sync v0.0.0-20180314180146-1d60e4601c6f/go.mod h1:RxMgew5VJxzue5/jJTE5uejpjVlOe/izrB70Jof72aM= golang.org/x/sync v0.0.0-20181108010431-42b317875d0f/go.mod h1:RxMgew5VJxzue5/jJTE5uejpjVlOe/izrB70Jof72aM= golang.org/x/sync v0.0.0-20181221193216-37e7f081c4d4/go.mod h1:RxMgew5VJxzue5/jJTE5uejpjVlOe/izrB70Jof72aM= golang.org/x/sync v0.0.0-20190423024810-112230192c58/go.mod h1:RxMgew5VJxzue5/jJTE5uejpjVlOe/izrB70Jof72aM= -golang.org/x/sync v0.0.0-20210220032951-036812b2e83c/go.mod h1:RxMgew5VJxzue5/jJTE5uejpjVlOe/izrB70Jof72aM= golang.org/x/sys v0.0.0-20180830151530-49385e6e1522/go.mod h1:STP8DvDyc/dI5b8T5hshtkjS+E42TnysNCUPdjciGhY= golang.org/x/sys v0.0.0-20190215142949-d0b11bdaac8a/go.mod h1:STP8DvDyc/dI5b8T5hshtkjS+E42TnysNCUPdjciGhY= golang.org/x/sys v0.0.0-20190222072716-a9d3bda3a223/go.mod h1:STP8DvDyc/dI5b8T5hshtkjS+E42TnysNCUPdjciGhY= @@ -156,27 +147,25 @@ golang.org/x/sys v0.0.0-20210330210617-4fbd30eecc44/go.mod h1:h1NjWce9XRLGQEsW7w golang.org/x/sys v0.0.0-20210510120138-977fb7262007/go.mod h1:oPkhp1MJrh7nUepCBck5+mAzfO9JrbApNNgaTdGDITg= golang.org/x/sys v0.0.0-20210630005230-0f9fa26af87c/go.mod h1:oPkhp1MJrh7nUepCBck5+mAzfO9JrbApNNgaTdGDITg= golang.org/x/sys v0.0.0-20210927094055-39ccf1dd6fa6/go.mod h1:oPkhp1MJrh7nUepCBck5+mAzfO9JrbApNNgaTdGDITg= -golang.org/x/sys v0.0.0-20220520151302-bc2c85ada10a h1:dGzPydgVsqGcTRVwiLJ1jVbufYwmzD3LfVPLKsKg+0k= -golang.org/x/sys v0.0.0-20220520151302-bc2c85ada10a/go.mod h1:oPkhp1MJrh7nUepCBck5+mAzfO9JrbApNNgaTdGDITg= +golang.org/x/sys v0.0.0-20220926163933-8cfa568d3c25 h1:nwzwVf0l2Y/lkov/+IYgMMbFyI+QypZDds9RxlSmsFQ= +golang.org/x/sys v0.0.0-20220926163933-8cfa568d3c25/go.mod h1:oPkhp1MJrh7nUepCBck5+mAzfO9JrbApNNgaTdGDITg= golang.org/x/term v0.0.0-20201126162022-7de9c90e9dd1/go.mod h1:bj7SfCRtBDWHUb9snDiAeCFNEtKQo2Wmx5Cou7ajbmo= golang.org/x/text v0.3.0/go.mod h1:NqM8EUOU14njkJ3fqMW+pc6Ldnwhi/IjpwHt7yyuwOQ= golang.org/x/text v0.3.3/go.mod h1:5Zoc/QRtKVWzQhOtBMvqHzDpF6irO9z98xDceosuGiQ= golang.org/x/text v0.3.5/go.mod h1:5Zoc/QRtKVWzQhOtBMvqHzDpF6irO9z98xDceosuGiQ= golang.org/x/text v0.3.7 h1:olpwvP2KacW1ZWvsR7uQhoyTYvKAupfQrRGBFM352Gk= golang.org/x/text v0.3.7/go.mod h1:u+2+/6zg+i71rQMx5EYifcz6MCKuco9NR6JIITiCfzQ= +golang.org/x/time v0.0.0-20220722155302-e5dcc9cfc0b9 h1:ftMN5LMiBFjbzleLqtoBZk7KdJwhuybIU+FckUHgoyQ= +golang.org/x/time v0.0.0-20220722155302-e5dcc9cfc0b9/go.mod h1:tRJNPiyCQ0inRvYxbN9jk5I+vvW/OXSQhTDSoE431IQ= golang.org/x/tools v0.0.0-20180917221912-90fa682c2a6e/go.mod h1:n7NCudcB/nEzxVGmLbDWY5pfWTLqBcC2KZ6jyYvM4mQ= golang.org/x/tools v0.0.0-20190114222345-bf090417da8b/go.mod h1:n7NCudcB/nEzxVGmLbDWY5pfWTLqBcC2KZ6jyYvM4mQ= golang.org/x/tools v0.0.0-20190226205152-f727befe758c/go.mod h1:9Yl7xja0Znq3iFh3HoIrodX9oNMXvdceNzlUR8zjMvY= golang.org/x/tools v0.0.0-20190311212946-11955173bddd/go.mod h1:LCzVGOaR6xXOjkQ3onu1FJEFr0SW1gC7cKk1uF8kGRs= golang.org/x/tools v0.0.0-20190524140312-2c0ae7006135/go.mod h1:RgjU9mgBXZiqYHBnxXauZ1Gv1EHHAz9KjViQ78xBX0Q= -golang.org/x/tools v0.0.0-20191119224855-298f0cb1881e/go.mod h1:b+2E5dAYhXwXZwtnZ6UAqBI28+e2cm9otk0dWdXHAEo= -golang.org/x/tools v0.1.5 h1:ouewzE6p+/VEB31YYnTbEJdi8pFqKp4P4n85vwo3DHA= -golang.org/x/tools v0.1.5/go.mod h1:o0xws9oXOQQZyjljx8fwUC0k7L1pTE6eaCbjGeHmOkk= -golang.org/x/xerrors v0.0.0-20190717185122-a985d3407aa7/go.mod h1:I/5z698sn9Ka8TeJc9MKroUUfqBBauWjQqLJ2OPfmY0= -golang.org/x/xerrors v0.0.0-20191011141410-1b5146add898/go.mod h1:I/5z698sn9Ka8TeJc9MKroUUfqBBauWjQqLJ2OPfmY0= +golang.org/x/tools v0.1.12 h1:VveCTK38A2rkS8ZqFY25HIDFscX5X9OoEhJd3quQmXU= golang.org/x/xerrors v0.0.0-20191204190536-9bdfabe68543/go.mod h1:I/5z698sn9Ka8TeJc9MKroUUfqBBauWjQqLJ2OPfmY0= -golang.org/x/xerrors v0.0.0-20200804184101-5ec99f83aff1 h1:go1bK/D/BFZV2I8cIQd1NKEZ+0owSTG1fDTci4IqFcE= golang.org/x/xerrors v0.0.0-20200804184101-5ec99f83aff1/go.mod h1:I/5z698sn9Ka8TeJc9MKroUUfqBBauWjQqLJ2OPfmY0= +golang.org/x/xerrors v0.0.0-20220907171357-04be3eba64a2 h1:H2TDz8ibqkAF6YGhCdN3jS9O0/s90v0rJh3X/OLHEUk= google.golang.org/appengine v1.1.0/go.mod h1:EbEs0AVv82hx2wNQdGPgUI5lhzA/G0D9YwlJXL52JkM= google.golang.org/appengine v1.4.0/go.mod h1:xpcJRLb0r/rnEns0DIKYYv+WjYCduHsrkT7/EB5XEv4= google.golang.org/genproto v0.0.0-20180817151627-c66870c02cf8/go.mod h1:JiN7NxoALGmiZfu7CAH4rXhgtRTLTxftemlI0sWmxmc= @@ -189,9 +178,9 @@ google.golang.org/grpc v1.19.0/go.mod h1:mqu4LbDTu4XGKhr4mRzUsmM4RtVoemTSY81AxZi google.golang.org/grpc v1.23.0/go.mod h1:Y5yQAOtifL1yxbo5wqy6BxZv8vAUGQwXBOALyacEbxg= google.golang.org/grpc v1.25.1/go.mod h1:c3i+UQWmh7LiEpx4sFZnkU36qjEYZ0imhYfXVyQciAY= google.golang.org/grpc v1.27.0/go.mod h1:qbnxyOmOxrQa7FizSgH+ReBfzJrCY1pSN7KXBS8abTk= +google.golang.org/grpc v1.32.0/go.mod h1:N36X2cJ7JwdamYAgDz+s+rVMFjt3numwzf/HckM8pak= google.golang.org/grpc v1.33.1/go.mod h1:fr5YgcSWrqhRRxogOsw7RzIpsmvOZ6IcH4kBYTpR3n0= google.golang.org/grpc v1.36.0/go.mod h1:qjiiYl8FncCW8feJPdyg3v6XW24KsRHe+dy9BAGRRjU= -google.golang.org/grpc v1.39.0/go.mod h1:PImNr+rS9TWYb2O4/emRugxiyHZ5JyHW5F+RPnDzfrE= google.golang.org/grpc v1.46.2/go.mod h1:vN9eftEi1UMyUsIF80+uQXhHjbXYbm0uXoFCACuMGWk= google.golang.org/grpc v1.47.0 h1:9n77onPX5F3qfFCqjy9dhn8PbNQsIKeVU04J9G7umt8= google.golang.org/grpc v1.47.0/go.mod h1:vN9eftEi1UMyUsIF80+uQXhHjbXYbm0uXoFCACuMGWk= @@ -211,7 +200,6 @@ google.golang.org/protobuf v1.28.0 h1:w43yiav+6bVFTBQFZX0r7ipe9JQ1QsbMgHwbBziscL google.golang.org/protobuf v1.28.0/go.mod h1:HV8QOd/L58Z+nl8r43ehVNZIU/HEI6OcFqwMG9pJV4I= gopkg.in/check.v1 v0.0.0-20161208181325-20d25e280405/go.mod h1:Co6ibVJAznAaIkqp8huTwlJQCZ016jof/cbN4VW5Yz0= gopkg.in/check.v1 v1.0.0-20180628173108-788fd7840127 h1:qIbj1fsPNlZgppZ+VLlY7N33q108Sa+fhmuc+sWQYwY= -gopkg.in/check.v1 v1.0.0-20180628173108-788fd7840127/go.mod h1:Co6ibVJAznAaIkqp8huTwlJQCZ016jof/cbN4VW5Yz0= gopkg.in/tomb.v2 v2.0.0-20161208151619-d5d1b5820637 h1:yiW+nvdHb9LVqSHQBXfZCieqV4fzYhNBql77zY0ykqs= gopkg.in/tomb.v2 v2.0.0-20161208151619-d5d1b5820637/go.mod h1:BHsqpu/nsuzkT5BpiH1EMZPLyqSMM8JbIavyFACoFNk= gopkg.in/yaml.v2 v2.2.2/go.mod h1:hI93XBmqTisBFMUTm0b8Fm+jr3Dg1NNxqwp+5A1VGuI= From bf92ffb4cc506e539f270e4a2fe969f511bed50e Mon Sep 17 00:00:00 2001 From: Haris Osmanagic Date: Wed, 28 Sep 2022 18:11:12 +0200 Subject: [PATCH 2/5] updates --- source/source.go | 91 ++++++++++++++++++++++++++++++++++++++---------- spec.go | 56 +++-------------------------- 2 files changed, 77 insertions(+), 70 deletions(-) diff --git a/source/source.go b/source/source.go index ec55b11..c98c5da 100644 --- a/source/source.go +++ b/source/source.go @@ -54,6 +54,50 @@ func NewSource() sdk.Source { } } +func (s *Source) Parameters() map[string]sdk.Parameter { + return map[string]sdk.Parameter{ + ConfigKeyEnvironment: { + Default: "", + Required: true, + Description: "Authorization service based on Organization’s Domain Name (e.g.: https://MyDomainName.my.salesforce.com -> `MyDomainName`) or `sandbox` for test environment.", + }, + ConfigKeyClientID: { + Default: "", + Required: true, + Description: "OAuth Client ID (Consumer Key).", + }, + ConfigKeyClientSecret: { + Default: "", + Required: true, + Description: "OAuth Client Secret (Consumer Secret).", + }, + ConfigKeyUsername: { + Default: "", + Required: true, + Description: "Username.", + }, + ConfigKeyPassword: { + Default: "", + Required: true, + Description: "Password.", + }, + ConfigKeySecurityToken: { + Default: "", + Required: false, + Description: "Security token as described here: https://help.salesforce.com/s/articleView?id=sf.user_security_token.htm&type=5.", + }, + ConfigKeyPushTopicsNames: { + Default: "", + Required: true, + Description: "The name or name pattern of the Push Topic to listen to. This value will be prefixed with `/topic/`.", + }, + ConfigKeyKeyField: { + Default: "Id", + Required: false, + Description: "The name of the field that should be used as a Payload's Key. Empty value will set it to `nil`.", + }, + } +} func (s *Source) Configure(_ context.Context, cfgRaw map[string]string) (err error) { s.config, err = ParseConfig(cfgRaw) if err != nil { @@ -134,17 +178,39 @@ func (s *Source) Read(ctx context.Context) (sdk.Record, error) { replayID := strconv.FormatInt(int64(event.Data.Event.ReplayID), 10) - var action internal.Operation - switch event.Data.Event.Type { case responses.CreatedEventType: - action = internal.OperationInsert + return sdk.SourceUtil{}.NewRecordCreate( + sdk.Position(replayID), + map[string]string{ + "channel": event.Channel, + "replayId": replayID, + }, + keyValue, + sdk.StructuredData(event.Data.SObject), + ), nil case responses.UpdatedEventType, responses.UndeletedEventType: - action = internal.OperationUpdate + return sdk.SourceUtil{}.NewRecordUpdate( + sdk.Position(replayID), + map[string]string{ + "channel": event.Channel, + "replayId": replayID, + }, + keyValue, + nil, + sdk.StructuredData(event.Data.SObject), + ), nil case responses.DeletedEventType: - action = internal.OperationDelete + return sdk.SourceUtil{}.NewRecordDelete( + sdk.Position(replayID), + map[string]string{ + "channel": event.Channel, + "replayId": replayID, + }, + keyValue, + ), nil default: sdk.Logger(ctx).Info().Msgf( @@ -152,22 +218,9 @@ func (s *Source) Read(ctx context.Context) (sdk.Record, error) { event.Data.Event.Type, internal.OperationInsert, ) - - action = internal.OperationInsert + return sdk.Record{}, sdk.ErrBackoffRetry } - return sdk.Record{ - Key: keyValue, - Payload: sdk.StructuredData(event.Data.SObject), - Position: sdk.Position(replayID), - CreatedAt: event.Data.Event.CreatedDate, - Metadata: map[string]string{ - "channel": event.Channel, - "replayId": replayID, - "action": action, - }, - }, nil - case <-s.tomb.Dead(): err := s.tomb.Err() if err == nil { diff --git a/spec.go b/spec.go index f4ffed9..3a397ad 100644 --- a/spec.go +++ b/spec.go @@ -16,60 +16,14 @@ package salesforce import ( sdk "github.com/conduitio/conduit-connector-sdk" - "github.com/miquido/conduit-connector-salesforce/source" ) func Specification() sdk.Specification { return sdk.Specification{ - Name: "salesforce", - Summary: "A Salesforce source plugin for Conduit.", - Description: "The Conduit plugin supporting Salesforce source.", - Version: "v0.1.0", - Author: "Miquido", - DestinationParams: map[string]sdk.Parameter{ - // - }, - SourceParams: map[string]sdk.Parameter{ - source.ConfigKeyEnvironment: { - Default: "", - Required: true, - Description: "Authorization service based on Organization’s Domain Name (e.g.: https://MyDomainName.my.salesforce.com -> `MyDomainName`) or `sandbox` for test environment.", - }, - source.ConfigKeyClientID: { - Default: "", - Required: true, - Description: "OAuth Client ID (Consumer Key).", - }, - source.ConfigKeyClientSecret: { - Default: "", - Required: true, - Description: "OAuth Client Secret (Consumer Secret).", - }, - source.ConfigKeyUsername: { - Default: "", - Required: true, - Description: "Username.", - }, - source.ConfigKeyPassword: { - Default: "", - Required: true, - Description: "Password.", - }, - source.ConfigKeySecurityToken: { - Default: "", - Required: false, - Description: "Security token as described here: https://help.salesforce.com/s/articleView?id=sf.user_security_token.htm&type=5.", - }, - source.ConfigKeyPushTopicsNames: { - Default: "", - Required: true, - Description: "The name or name pattern of the Push Topic to listen to. This value will be prefixed with `/topic/`.", - }, - source.ConfigKeyKeyField: { - Default: "Id", - Required: false, - Description: "The name of the field that should be used as a Payload's Key. Empty value will set it to `nil`.", - }, - }, + Name: "salesforce", + Summary: "A Salesforce source plugin for Conduit.", + Description: "The Conduit plugin supporting Salesforce source.", + Version: "v0.1.0", + Author: "Miquido & Meroxa, Inc.", } } From ff2b75d702ba814a7c81601cc69d56f59e2eca2f Mon Sep 17 00:00:00 2001 From: Haris Osmanagic Date: Wed, 28 Sep 2022 18:57:24 +0200 Subject: [PATCH 3/5] fixes --- README.md | 7 +++++- cmd/sf/streaming_client_mock_test.go | 5 ++--- destination/.gitkeep | 0 source/source.go | 33 +++++++++++++++++----------- 4 files changed, 28 insertions(+), 17 deletions(-) delete mode 100644 destination/.gitkeep diff --git a/README.md b/README.md index 4ca2b31..14198c3 100644 --- a/README.md +++ b/README.md @@ -76,7 +76,12 @@ There may be need to reconnect while connector is working. Server returns condit There are a couple of steps that need to be done to start working with Salesforce connector. 1. Log in into Your Salesforce account, e.g. https://my-demo-app.my.salesforce.com. The environment is `my-demo-app`. -2. First, if not already done, You need to create connected app and enable OAuth: [Enable OAuth Settings for API Integration](https://help.salesforce.com/s/articleView?id=sf.connected_app_create_api_integration.htm&type=5). Successfully configured app example can be seen below: +2. First, if not already done, You need to create connected app and enable OAuth: [Enable OAuth Settings for API Integration](https://help.salesforce.com/s/articleView?id=sf.connected_app_create_api_integration.htm&type=5). + + The callback URL is required, but not relevant for this connector, so you can put anything there. + + Successfully configured app example can be seen below: + ![Connected App example](docs/connect_and_configure_app.png) 3. Copy **Consumer Key** and **Consumer Secret**. If You need these values once again You can always find them in _Setup -> Apps -> App Manager_, find app on the list and choose _View_ option. ![View OAuth tokens](docs/view_oauth_tokens.png) diff --git a/cmd/sf/streaming_client_mock_test.go b/cmd/sf/streaming_client_mock_test.go index 264cb2b..d50f56f 100644 --- a/cmd/sf/streaming_client_mock_test.go +++ b/cmd/sf/streaming_client_mock_test.go @@ -53,10 +53,9 @@ func (s *streamingClientMock) Connect(_ context.Context) (responses.ConnectRespo response.Events = append(response.Events, responses.ConnectResponseEvent{ Data: responses.ConnectResponseEventData{ Event: responses.ConnectResponseEventDataMetadata{ - CreatedDate: record.CreatedAt, - ReplayID: s.lastIndex, + ReplayID: s.lastIndex, }, - SObject: record.Payload.(sdk.StructuredData), + SObject: record.Payload.After.(sdk.StructuredData), }, Channel: "MyTopic1", }) diff --git a/destination/.gitkeep b/destination/.gitkeep deleted file mode 100644 index e69de29..0000000 diff --git a/source/source.go b/source/source.go index c98c5da..1f583de 100644 --- a/source/source.go +++ b/source/source.go @@ -182,10 +182,7 @@ func (s *Source) Read(ctx context.Context) (sdk.Record, error) { case responses.CreatedEventType: return sdk.SourceUtil{}.NewRecordCreate( sdk.Position(replayID), - map[string]string{ - "channel": event.Channel, - "replayId": replayID, - }, + s.getMetadata(event), keyValue, sdk.StructuredData(event.Data.SObject), ), nil @@ -193,10 +190,7 @@ func (s *Source) Read(ctx context.Context) (sdk.Record, error) { case responses.UpdatedEventType, responses.UndeletedEventType: return sdk.SourceUtil{}.NewRecordUpdate( sdk.Position(replayID), - map[string]string{ - "channel": event.Channel, - "replayId": replayID, - }, + s.getMetadata(event), keyValue, nil, sdk.StructuredData(event.Data.SObject), @@ -205,10 +199,7 @@ func (s *Source) Read(ctx context.Context) (sdk.Record, error) { case responses.DeletedEventType: return sdk.SourceUtil{}.NewRecordDelete( sdk.Position(replayID), - map[string]string{ - "channel": event.Channel, - "replayId": replayID, - }, + s.getMetadata(event), keyValue, ), nil @@ -218,7 +209,12 @@ func (s *Source) Read(ctx context.Context) (sdk.Record, error) { event.Data.Event.Type, internal.OperationInsert, ) - return sdk.Record{}, sdk.ErrBackoffRetry + return sdk.SourceUtil{}.NewRecordCreate( + sdk.Position(replayID), + s.getMetadata(event), + keyValue, + sdk.StructuredData(event.Data.SObject), + ), nil } case <-s.tomb.Dead(): @@ -234,6 +230,17 @@ func (s *Source) Read(ctx context.Context) (sdk.Record, error) { } } +func (s *Source) getMetadata(event responses.ConnectResponseEvent) map[string]string { + replayID := strconv.FormatInt(int64(event.Data.Event.ReplayID), 10) + + m := sdk.Metadata{ + "channel": event.Channel, + "replayId": replayID, + } + m.SetCreatedAt(event.Data.Event.CreatedDate) + return m +} + func (s *Source) Ack(ctx context.Context, position sdk.Position) error { sdk.Logger(ctx).Debug().Str("position", string(position)).Msg("got ack") From 0bc0f791199bbfd951a0d3a5157c5230e8539db6 Mon Sep 17 00:00:00 2001 From: Haris Osmanagic Date: Thu, 29 Sep 2022 12:48:34 +0200 Subject: [PATCH 4/5] lint workflow update --- .github/workflows/lint.yml | 9 +++++++-- 1 file changed, 7 insertions(+), 2 deletions(-) diff --git a/.github/workflows/lint.yml b/.github/workflows/lint.yml index 9a4a468..287c723 100644 --- a/.github/workflows/lint.yml +++ b/.github/workflows/lint.yml @@ -10,7 +10,12 @@ jobs: runs-on: ubuntu-latest steps: - uses: actions/checkout@v3 + - uses: actions/setup-go@v3 + with: + go-version: 1.18 + - name: golangci-lint - uses: golangci/golangci-lint-action@v3.2.0 + uses: golangci/golangci-lint-action@v3 with: - version: v1.45.2 + version: v1.49.0 + From 2fff22836a3a3254350aa873afed7731b4432513 Mon Sep 17 00:00:00 2001 From: Haris Osmanagic Date: Thu, 29 Sep 2022 12:56:22 +0200 Subject: [PATCH 5/5] update build workflow --- .github/workflows/build.yml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.github/workflows/build.yml b/.github/workflows/build.yml index 30a11c1..709dbdc 100644 --- a/.github/workflows/build.yml +++ b/.github/workflows/build.yml @@ -14,7 +14,7 @@ jobs: - name: Set up Go uses: actions/setup-go@v3 with: - go-version: 1.17 + go-version: 1.18 - name: Test run: make test GOTEST_FLAGS="-v -count=1"