use correct go mod semver (#395)
Signed-off-by: Scott Nichols <snichols@vmware.com>
This commit is contained in:
parent
f248e16041
commit
0a5202bf31
|
|
@ -35,16 +35,16 @@ jobs:
|
||||||
|
|
||||||
- restore_cache:
|
- restore_cache:
|
||||||
keys:
|
keys:
|
||||||
- gomod-cache-{{ checksum "go.sum" }}
|
- gomod-cache-{{ checksum "v2/go.sum" }}
|
||||||
- run:
|
- run:
|
||||||
name: "Check modules via go tidy"
|
name: "Check modules via go tidy"
|
||||||
command: go mod tidy && git diff --exit-code go.{mod,sum}
|
command: pushd v2; go mod tidy && git diff --exit-code go.{mod,sum}; popd
|
||||||
- run:
|
- run:
|
||||||
name: "Enforce Go Formatted Code"
|
name: "Enforce Go Formatted Code"
|
||||||
command: "! GO111MODULE=off go fmt ./... 2>&1 | read" # Avoid any dependency resolution
|
command: "! GO111MODULE=off go fmt ./v2/... 2>&1 | read" # Avoid any dependency resolution
|
||||||
- run:
|
- run:
|
||||||
name: "Run go vet"
|
name: "Run go vet"
|
||||||
command: go vet ./...
|
command: pushd v2; go vet ./...; popd
|
||||||
- run:
|
- run:
|
||||||
name: Run unit tests
|
name: Run unit tests
|
||||||
command: |
|
command: |
|
||||||
|
|
@ -55,7 +55,7 @@ jobs:
|
||||||
TEST_AMQP_URL=amqp://localhost/test ./hack/integration-test.sh | tee ${TEST_RESULTS}/go-integration-test.out
|
TEST_AMQP_URL=amqp://localhost/test ./hack/integration-test.sh | tee ${TEST_RESULTS}/go-integration-test.out
|
||||||
|
|
||||||
- save_cache:
|
- save_cache:
|
||||||
key: gomod-cache-{{ checksum "go.sum" }}
|
key: gomod-cache-{{ checksum "v2/go.sum" }}
|
||||||
paths:
|
paths:
|
||||||
- "/go/pkg/mod"
|
- "/go/pkg/mod"
|
||||||
|
|
||||||
|
|
|
||||||
|
|
@ -4,8 +4,13 @@ set -o errexit
|
||||||
set -o nounset
|
set -o nounset
|
||||||
set -o pipefail
|
set -o pipefail
|
||||||
|
|
||||||
|
# v2 only
|
||||||
|
pushd ./v2
|
||||||
|
|
||||||
# Run integration tests not in parallel
|
# Run integration tests not in parallel
|
||||||
go test -v -parallel 1 ./test/... -coverprofile ${TEST_RESULTS:-.}/integration_test_cover.out -timeout 60s
|
go test -v -parallel 1 ./test/... -coverprofile ${TEST_RESULTS:-.}/integration_test_cover.out -timeout 60s
|
||||||
|
|
||||||
# Remove test only deps.
|
# Remove test only deps.
|
||||||
go mod tidy
|
go mod tidy
|
||||||
|
|
||||||
|
popd
|
||||||
|
|
|
||||||
|
|
@ -4,8 +4,16 @@ set -o errexit
|
||||||
set -o nounset
|
set -o nounset
|
||||||
set -o pipefail
|
set -o pipefail
|
||||||
|
|
||||||
# Test everything in pkg and cmd, except amqp
|
# v1
|
||||||
go test -v ./pkg/... ./cmd/... -coverprofile ${TEST_RESULTS:-.}/unit_test_cover.out -timeout 15s
|
pushd ./v1
|
||||||
|
go test -v ./... -coverprofile ${TEST_RESULTS:-.}/unit_test_cover.out -timeout 15s
|
||||||
# Remove test only deps.
|
# Remove test only deps.
|
||||||
go mod tidy
|
go mod tidy
|
||||||
|
popd
|
||||||
|
|
||||||
|
# v2
|
||||||
|
pushd ./v2
|
||||||
|
go test -v ./... -coverprofile ${TEST_RESULTS:-.}/unit_test_cover.out -timeout 15s
|
||||||
|
# Remove test only deps.
|
||||||
|
go mod tidy
|
||||||
|
popd
|
||||||
|
|
@ -1,4 +1,4 @@
|
||||||
# NOTE: The Legacy directory will be removed for v2.0.0.
|
# NOTE: The v1 directory will be removed for v2.0.0.
|
||||||
|
|
||||||
We will make a final migration release that will match the v2.0.0 release with
|
We will make a final migration release that will match the v2.0.0 release with
|
||||||
the addition of this legacy directory for migration support.
|
the addition of this legacy directory for migration support.
|
||||||
|
|
@ -1,15 +1,15 @@
|
||||||
package cloudevents
|
package v1
|
||||||
|
|
||||||
// Package cloudevents alias' common functions and types to improve discoverability and reduce
|
// Package cloudevents alias' common functions and types to improve discoverability and reduce
|
||||||
// the number of imports for simple HTTP clients.
|
// the number of imports for simple HTTP clients.
|
||||||
|
|
||||||
import (
|
import (
|
||||||
"github.com/cloudevents/sdk-go/legacy/pkg/cloudevents"
|
"github.com/cloudevents/sdk-go/v1/cloudevents"
|
||||||
"github.com/cloudevents/sdk-go/legacy/pkg/cloudevents/client"
|
"github.com/cloudevents/sdk-go/v1/cloudevents/client"
|
||||||
"github.com/cloudevents/sdk-go/legacy/pkg/cloudevents/context"
|
"github.com/cloudevents/sdk-go/v1/cloudevents/context"
|
||||||
"github.com/cloudevents/sdk-go/legacy/pkg/cloudevents/observability"
|
"github.com/cloudevents/sdk-go/v1/cloudevents/observability"
|
||||||
"github.com/cloudevents/sdk-go/legacy/pkg/cloudevents/transport/http"
|
"github.com/cloudevents/sdk-go/v1/cloudevents/transport/http"
|
||||||
"github.com/cloudevents/sdk-go/legacy/pkg/cloudevents/types"
|
"github.com/cloudevents/sdk-go/v1/cloudevents/types"
|
||||||
)
|
)
|
||||||
|
|
||||||
// Client
|
// Client
|
||||||
|
|
@ -3,7 +3,7 @@ package buffering
|
||||||
import (
|
import (
|
||||||
"sync/atomic"
|
"sync/atomic"
|
||||||
|
|
||||||
"github.com/cloudevents/sdk-go/legacy/pkg/binding"
|
"github.com/cloudevents/sdk-go/v1/binding"
|
||||||
)
|
)
|
||||||
|
|
||||||
type acksMessage struct {
|
type acksMessage struct {
|
||||||
|
|
@ -8,9 +8,9 @@ import (
|
||||||
|
|
||||||
"github.com/stretchr/testify/assert"
|
"github.com/stretchr/testify/assert"
|
||||||
|
|
||||||
cloudevents "github.com/cloudevents/sdk-go/legacy"
|
cloudevents "github.com/cloudevents/sdk-go/v1"
|
||||||
"github.com/cloudevents/sdk-go/legacy/pkg/binding"
|
"github.com/cloudevents/sdk-go/v1/binding"
|
||||||
"github.com/cloudevents/sdk-go/legacy/pkg/cloudevents/types"
|
"github.com/cloudevents/sdk-go/v1/cloudevents/types"
|
||||||
)
|
)
|
||||||
|
|
||||||
func TestWithAcksBeforeFinish(t *testing.T) {
|
func TestWithAcksBeforeFinish(t *testing.T) {
|
||||||
|
|
@ -7,8 +7,8 @@ import (
|
||||||
|
|
||||||
"github.com/valyala/bytebufferpool"
|
"github.com/valyala/bytebufferpool"
|
||||||
|
|
||||||
"github.com/cloudevents/sdk-go/legacy/pkg/binding"
|
"github.com/cloudevents/sdk-go/v1/binding"
|
||||||
"github.com/cloudevents/sdk-go/legacy/pkg/binding/spec"
|
"github.com/cloudevents/sdk-go/v1/binding/spec"
|
||||||
)
|
)
|
||||||
|
|
||||||
var binaryMessagePool bytebufferpool.Pool
|
var binaryMessagePool bytebufferpool.Pool
|
||||||
|
|
@ -3,7 +3,7 @@ package buffering
|
||||||
import (
|
import (
|
||||||
"context"
|
"context"
|
||||||
|
|
||||||
"github.com/cloudevents/sdk-go/legacy/pkg/binding"
|
"github.com/cloudevents/sdk-go/v1/binding"
|
||||||
)
|
)
|
||||||
|
|
||||||
// BufferMessage does the same than CopyMessage and it also bounds the original Message
|
// BufferMessage does the same than CopyMessage and it also bounds the original Message
|
||||||
|
|
@ -4,7 +4,7 @@ import (
|
||||||
"context"
|
"context"
|
||||||
"testing"
|
"testing"
|
||||||
|
|
||||||
"github.com/cloudevents/sdk-go/legacy/pkg/binding/test"
|
"github.com/cloudevents/sdk-go/v1/binding/test"
|
||||||
)
|
)
|
||||||
|
|
||||||
var err error
|
var err error
|
||||||
|
|
@ -8,9 +8,9 @@ import (
|
||||||
"github.com/stretchr/testify/assert"
|
"github.com/stretchr/testify/assert"
|
||||||
"github.com/stretchr/testify/require"
|
"github.com/stretchr/testify/require"
|
||||||
|
|
||||||
"github.com/cloudevents/sdk-go/legacy/pkg/binding"
|
"github.com/cloudevents/sdk-go/v1/binding"
|
||||||
"github.com/cloudevents/sdk-go/legacy/pkg/binding/test"
|
"github.com/cloudevents/sdk-go/v1/binding/test"
|
||||||
"github.com/cloudevents/sdk-go/legacy/pkg/cloudevents"
|
"github.com/cloudevents/sdk-go/v1/cloudevents"
|
||||||
)
|
)
|
||||||
|
|
||||||
type copyMessageTestCase struct {
|
type copyMessageTestCase struct {
|
||||||
|
|
@ -7,8 +7,8 @@ import (
|
||||||
|
|
||||||
"github.com/valyala/bytebufferpool"
|
"github.com/valyala/bytebufferpool"
|
||||||
|
|
||||||
"github.com/cloudevents/sdk-go/legacy/pkg/binding"
|
"github.com/cloudevents/sdk-go/v1/binding"
|
||||||
"github.com/cloudevents/sdk-go/legacy/pkg/binding/format"
|
"github.com/cloudevents/sdk-go/v1/binding/format"
|
||||||
)
|
)
|
||||||
|
|
||||||
var structMessagePool bytebufferpool.Pool
|
var structMessagePool bytebufferpool.Pool
|
||||||
|
|
@ -4,10 +4,10 @@ import (
|
||||||
"bytes"
|
"bytes"
|
||||||
"context"
|
"context"
|
||||||
|
|
||||||
cloudevents "github.com/cloudevents/sdk-go/legacy"
|
cloudevents "github.com/cloudevents/sdk-go/v1"
|
||||||
"github.com/cloudevents/sdk-go/legacy/pkg/binding/format"
|
"github.com/cloudevents/sdk-go/v1/binding/format"
|
||||||
"github.com/cloudevents/sdk-go/legacy/pkg/binding/spec"
|
"github.com/cloudevents/sdk-go/v1/binding/spec"
|
||||||
ce "github.com/cloudevents/sdk-go/legacy/pkg/cloudevents"
|
ce "github.com/cloudevents/sdk-go/v1/cloudevents"
|
||||||
)
|
)
|
||||||
|
|
||||||
// EventMessage type-converts a cloudevents.Event object to implement Message.
|
// EventMessage type-converts a cloudevents.Event object to implement Message.
|
||||||
|
|
@ -7,9 +7,9 @@ import (
|
||||||
"io"
|
"io"
|
||||||
"io/ioutil"
|
"io/ioutil"
|
||||||
|
|
||||||
"github.com/cloudevents/sdk-go/legacy/pkg/binding"
|
"github.com/cloudevents/sdk-go/v1/binding"
|
||||||
"github.com/cloudevents/sdk-go/legacy/pkg/binding/format"
|
"github.com/cloudevents/sdk-go/v1/binding/format"
|
||||||
"github.com/cloudevents/sdk-go/legacy/pkg/cloudevents/transport"
|
"github.com/cloudevents/sdk-go/v1/cloudevents/transport"
|
||||||
)
|
)
|
||||||
|
|
||||||
// ExMessage is a json.RawMessage, a byte slice containing a JSON encoded event.
|
// ExMessage is a json.RawMessage, a byte slice containing a JSON encoded event.
|
||||||
|
|
@ -6,8 +6,8 @@ import (
|
||||||
"io"
|
"io"
|
||||||
"strconv"
|
"strconv"
|
||||||
|
|
||||||
"github.com/cloudevents/sdk-go/legacy/pkg/cloudevents"
|
"github.com/cloudevents/sdk-go/v1/cloudevents"
|
||||||
"github.com/cloudevents/sdk-go/legacy/pkg/cloudevents/client"
|
"github.com/cloudevents/sdk-go/v1/cloudevents/client"
|
||||||
)
|
)
|
||||||
|
|
||||||
const count = 3 // Example ends after this many events.
|
const count = 3 // Example ends after this many events.
|
||||||
|
|
@ -7,9 +7,9 @@ import (
|
||||||
|
|
||||||
"github.com/stretchr/testify/assert"
|
"github.com/stretchr/testify/assert"
|
||||||
|
|
||||||
cloudevents "github.com/cloudevents/sdk-go/legacy"
|
cloudevents "github.com/cloudevents/sdk-go/v1"
|
||||||
"github.com/cloudevents/sdk-go/legacy/pkg/binding"
|
"github.com/cloudevents/sdk-go/v1/binding"
|
||||||
"github.com/cloudevents/sdk-go/legacy/pkg/cloudevents/types"
|
"github.com/cloudevents/sdk-go/v1/cloudevents/types"
|
||||||
)
|
)
|
||||||
|
|
||||||
func TestWithFinish(t *testing.T) {
|
func TestWithFinish(t *testing.T) {
|
||||||
|
|
@ -11,7 +11,7 @@ import (
|
||||||
"fmt"
|
"fmt"
|
||||||
"strings"
|
"strings"
|
||||||
|
|
||||||
ce "github.com/cloudevents/sdk-go/legacy/pkg/cloudevents"
|
ce "github.com/cloudevents/sdk-go/v1/cloudevents"
|
||||||
)
|
)
|
||||||
|
|
||||||
// Format marshals and unmarshals structured events to bytes.
|
// Format marshals and unmarshals structured events to bytes.
|
||||||
|
|
@ -5,9 +5,9 @@ import (
|
||||||
|
|
||||||
"github.com/stretchr/testify/assert"
|
"github.com/stretchr/testify/assert"
|
||||||
|
|
||||||
"github.com/cloudevents/sdk-go/legacy/pkg/binding/format"
|
"github.com/cloudevents/sdk-go/v1/binding/format"
|
||||||
ce "github.com/cloudevents/sdk-go/legacy/pkg/cloudevents"
|
ce "github.com/cloudevents/sdk-go/v1/cloudevents"
|
||||||
"github.com/cloudevents/sdk-go/legacy/pkg/cloudevents/types"
|
"github.com/cloudevents/sdk-go/v1/cloudevents/types"
|
||||||
)
|
)
|
||||||
|
|
||||||
func TestJSON(t *testing.T) {
|
func TestJSON(t *testing.T) {
|
||||||
|
|
@ -5,8 +5,8 @@ import (
|
||||||
"errors"
|
"errors"
|
||||||
"io"
|
"io"
|
||||||
|
|
||||||
"github.com/cloudevents/sdk-go/legacy/pkg/binding/format"
|
"github.com/cloudevents/sdk-go/v1/binding/format"
|
||||||
"github.com/cloudevents/sdk-go/legacy/pkg/binding/spec"
|
"github.com/cloudevents/sdk-go/v1/binding/spec"
|
||||||
)
|
)
|
||||||
|
|
||||||
// Encoding enum specifies the type of encodings supported by binding interfaces
|
// Encoding enum specifies the type of encodings supported by binding interfaces
|
||||||
|
|
@ -4,8 +4,8 @@ import (
|
||||||
"fmt"
|
"fmt"
|
||||||
"time"
|
"time"
|
||||||
|
|
||||||
ce "github.com/cloudevents/sdk-go/legacy/pkg/cloudevents"
|
ce "github.com/cloudevents/sdk-go/v1/cloudevents"
|
||||||
"github.com/cloudevents/sdk-go/legacy/pkg/cloudevents/types"
|
"github.com/cloudevents/sdk-go/v1/cloudevents/types"
|
||||||
)
|
)
|
||||||
|
|
||||||
// Kind is a version-independent identifier for a CloudEvent context attribute.
|
// Kind is a version-independent identifier for a CloudEvent context attribute.
|
||||||
|
|
@ -4,7 +4,7 @@ import (
|
||||||
"testing"
|
"testing"
|
||||||
"time"
|
"time"
|
||||||
|
|
||||||
"github.com/cloudevents/sdk-go/legacy/pkg/binding/spec"
|
"github.com/cloudevents/sdk-go/v1/binding/spec"
|
||||||
"github.com/google/go-cmp/cmp"
|
"github.com/google/go-cmp/cmp"
|
||||||
"github.com/stretchr/testify/assert"
|
"github.com/stretchr/testify/assert"
|
||||||
)
|
)
|
||||||
|
|
@ -4,8 +4,8 @@ import (
|
||||||
"fmt"
|
"fmt"
|
||||||
"strings"
|
"strings"
|
||||||
|
|
||||||
ce "github.com/cloudevents/sdk-go/legacy/pkg/cloudevents"
|
ce "github.com/cloudevents/sdk-go/v1/cloudevents"
|
||||||
"github.com/cloudevents/sdk-go/legacy/pkg/cloudevents/types"
|
"github.com/cloudevents/sdk-go/v1/cloudevents/types"
|
||||||
)
|
)
|
||||||
|
|
||||||
// Version provides meta-data for a single spec-version.
|
// Version provides meta-data for a single spec-version.
|
||||||
|
|
@ -3,8 +3,8 @@ package spec_test
|
||||||
import (
|
import (
|
||||||
"testing"
|
"testing"
|
||||||
|
|
||||||
"github.com/cloudevents/sdk-go/legacy/pkg/binding/spec"
|
"github.com/cloudevents/sdk-go/v1/binding/spec"
|
||||||
ce "github.com/cloudevents/sdk-go/legacy/pkg/cloudevents"
|
ce "github.com/cloudevents/sdk-go/v1/cloudevents"
|
||||||
"github.com/stretchr/testify/assert"
|
"github.com/stretchr/testify/assert"
|
||||||
)
|
)
|
||||||
|
|
||||||
|
|
@ -7,7 +7,7 @@ import (
|
||||||
"github.com/stretchr/testify/assert"
|
"github.com/stretchr/testify/assert"
|
||||||
"golang.org/x/sync/errgroup"
|
"golang.org/x/sync/errgroup"
|
||||||
|
|
||||||
"github.com/cloudevents/sdk-go/legacy/pkg/binding"
|
"github.com/cloudevents/sdk-go/v1/binding"
|
||||||
)
|
)
|
||||||
|
|
||||||
// Simple send/receive benchmark.
|
// Simple send/receive benchmark.
|
||||||
|
|
@ -7,9 +7,9 @@ import (
|
||||||
"reflect"
|
"reflect"
|
||||||
"time"
|
"time"
|
||||||
|
|
||||||
"github.com/cloudevents/sdk-go/legacy/pkg/binding/spec"
|
"github.com/cloudevents/sdk-go/v1/binding/spec"
|
||||||
ce "github.com/cloudevents/sdk-go/legacy/pkg/cloudevents"
|
ce "github.com/cloudevents/sdk-go/v1/cloudevents"
|
||||||
"github.com/cloudevents/sdk-go/legacy/pkg/cloudevents/types"
|
"github.com/cloudevents/sdk-go/v1/cloudevents/types"
|
||||||
)
|
)
|
||||||
|
|
||||||
func strptr(s string) *string { return &s }
|
func strptr(s string) *string { return &s }
|
||||||
|
|
@ -6,9 +6,9 @@ import (
|
||||||
"io"
|
"io"
|
||||||
"io/ioutil"
|
"io/ioutil"
|
||||||
|
|
||||||
cloudevents "github.com/cloudevents/sdk-go/legacy"
|
cloudevents "github.com/cloudevents/sdk-go/v1"
|
||||||
"github.com/cloudevents/sdk-go/legacy/pkg/binding"
|
"github.com/cloudevents/sdk-go/v1/binding"
|
||||||
"github.com/cloudevents/sdk-go/legacy/pkg/binding/spec"
|
"github.com/cloudevents/sdk-go/v1/binding/spec"
|
||||||
)
|
)
|
||||||
|
|
||||||
// MockBinaryMessage implements a binary-mode message as a simple struct.
|
// MockBinaryMessage implements a binary-mode message as a simple struct.
|
||||||
|
|
@ -6,9 +6,9 @@ import (
|
||||||
"io"
|
"io"
|
||||||
"io/ioutil"
|
"io/ioutil"
|
||||||
|
|
||||||
cloudevents "github.com/cloudevents/sdk-go/legacy"
|
cloudevents "github.com/cloudevents/sdk-go/v1"
|
||||||
"github.com/cloudevents/sdk-go/legacy/pkg/binding"
|
"github.com/cloudevents/sdk-go/v1/binding"
|
||||||
"github.com/cloudevents/sdk-go/legacy/pkg/binding/format"
|
"github.com/cloudevents/sdk-go/v1/binding/format"
|
||||||
)
|
)
|
||||||
|
|
||||||
// MockStructuredMessage implements a structured-mode message as a simple struct.
|
// MockStructuredMessage implements a structured-mode message as a simple struct.
|
||||||
|
|
@ -12,12 +12,12 @@ import (
|
||||||
"github.com/stretchr/testify/assert"
|
"github.com/stretchr/testify/assert"
|
||||||
"github.com/stretchr/testify/require"
|
"github.com/stretchr/testify/require"
|
||||||
|
|
||||||
cloudevents "github.com/cloudevents/sdk-go/legacy"
|
cloudevents "github.com/cloudevents/sdk-go/v1"
|
||||||
"github.com/cloudevents/sdk-go/legacy/pkg/binding"
|
"github.com/cloudevents/sdk-go/v1/binding"
|
||||||
"github.com/cloudevents/sdk-go/legacy/pkg/binding/format"
|
"github.com/cloudevents/sdk-go/v1/binding/format"
|
||||||
"github.com/cloudevents/sdk-go/legacy/pkg/binding/spec"
|
"github.com/cloudevents/sdk-go/v1/binding/spec"
|
||||||
ce "github.com/cloudevents/sdk-go/legacy/pkg/cloudevents"
|
ce "github.com/cloudevents/sdk-go/v1/cloudevents"
|
||||||
"github.com/cloudevents/sdk-go/legacy/pkg/cloudevents/types"
|
"github.com/cloudevents/sdk-go/v1/cloudevents/types"
|
||||||
)
|
)
|
||||||
|
|
||||||
// NameOf generates a string test name from x, esp. for ce.Event and ce.Message.
|
// NameOf generates a string test name from x, esp. for ce.Event and ce.Message.
|
||||||
|
|
@ -6,8 +6,8 @@ import (
|
||||||
|
|
||||||
"github.com/stretchr/testify/assert"
|
"github.com/stretchr/testify/assert"
|
||||||
|
|
||||||
"github.com/cloudevents/sdk-go/legacy/pkg/binding"
|
"github.com/cloudevents/sdk-go/v1/binding"
|
||||||
"github.com/cloudevents/sdk-go/legacy/pkg/binding/test"
|
"github.com/cloudevents/sdk-go/v1/binding/test"
|
||||||
)
|
)
|
||||||
|
|
||||||
func TestEvent(t *testing.T) {
|
func TestEvent(t *testing.T) {
|
||||||
|
|
@ -6,8 +6,8 @@ import (
|
||||||
|
|
||||||
"github.com/stretchr/testify/require"
|
"github.com/stretchr/testify/require"
|
||||||
|
|
||||||
cloudevents "github.com/cloudevents/sdk-go/legacy"
|
cloudevents "github.com/cloudevents/sdk-go/v1"
|
||||||
"github.com/cloudevents/sdk-go/legacy/pkg/binding"
|
"github.com/cloudevents/sdk-go/v1/binding"
|
||||||
)
|
)
|
||||||
|
|
||||||
type TranscoderTestArgs struct {
|
type TranscoderTestArgs struct {
|
||||||
|
|
@ -6,11 +6,11 @@ import (
|
||||||
"errors"
|
"errors"
|
||||||
"io"
|
"io"
|
||||||
|
|
||||||
cloudevents "github.com/cloudevents/sdk-go/legacy"
|
cloudevents "github.com/cloudevents/sdk-go/v1"
|
||||||
"github.com/cloudevents/sdk-go/legacy/pkg/binding/format"
|
"github.com/cloudevents/sdk-go/v1/binding/format"
|
||||||
"github.com/cloudevents/sdk-go/legacy/pkg/binding/spec"
|
"github.com/cloudevents/sdk-go/v1/binding/spec"
|
||||||
ce "github.com/cloudevents/sdk-go/legacy/pkg/cloudevents"
|
ce "github.com/cloudevents/sdk-go/v1/cloudevents"
|
||||||
"github.com/cloudevents/sdk-go/legacy/pkg/cloudevents/types"
|
"github.com/cloudevents/sdk-go/v1/cloudevents/types"
|
||||||
)
|
)
|
||||||
|
|
||||||
var ErrCannotConvertToEvent = errors.New("cannot convert message to event")
|
var ErrCannotConvertToEvent = errors.New("cannot convert message to event")
|
||||||
|
|
@ -6,9 +6,9 @@ import (
|
||||||
|
|
||||||
"github.com/stretchr/testify/require"
|
"github.com/stretchr/testify/require"
|
||||||
|
|
||||||
"github.com/cloudevents/sdk-go/legacy/pkg/binding"
|
"github.com/cloudevents/sdk-go/v1/binding"
|
||||||
"github.com/cloudevents/sdk-go/legacy/pkg/binding/test"
|
"github.com/cloudevents/sdk-go/v1/binding/test"
|
||||||
"github.com/cloudevents/sdk-go/legacy/pkg/cloudevents"
|
"github.com/cloudevents/sdk-go/v1/cloudevents"
|
||||||
)
|
)
|
||||||
|
|
||||||
type toEventTestCase struct {
|
type toEventTestCase struct {
|
||||||
|
|
@ -1,6 +1,6 @@
|
||||||
package binding
|
package binding
|
||||||
|
|
||||||
import ce "github.com/cloudevents/sdk-go/legacy"
|
import ce "github.com/cloudevents/sdk-go/v1"
|
||||||
|
|
||||||
// Implements a transformation process while transferring the event from the Message implementation
|
// Implements a transformation process while transferring the event from the Message implementation
|
||||||
// to the provided encoder
|
// to the provided encoder
|
||||||
|
|
@ -1,9 +1,9 @@
|
||||||
package transcoder
|
package transcoder
|
||||||
|
|
||||||
import (
|
import (
|
||||||
cloudevents "github.com/cloudevents/sdk-go/legacy"
|
cloudevents "github.com/cloudevents/sdk-go/v1"
|
||||||
"github.com/cloudevents/sdk-go/legacy/pkg/binding"
|
"github.com/cloudevents/sdk-go/v1/binding"
|
||||||
"github.com/cloudevents/sdk-go/legacy/pkg/binding/spec"
|
"github.com/cloudevents/sdk-go/v1/binding/spec"
|
||||||
)
|
)
|
||||||
|
|
||||||
// Add cloudevents attribute (if missing) during the encoding process
|
// Add cloudevents attribute (if missing) during the encoding process
|
||||||
|
|
@ -7,10 +7,10 @@ import (
|
||||||
|
|
||||||
"github.com/stretchr/testify/require"
|
"github.com/stretchr/testify/require"
|
||||||
|
|
||||||
"github.com/cloudevents/sdk-go/legacy/pkg/binding"
|
"github.com/cloudevents/sdk-go/v1/binding"
|
||||||
"github.com/cloudevents/sdk-go/legacy/pkg/binding/spec"
|
"github.com/cloudevents/sdk-go/v1/binding/spec"
|
||||||
"github.com/cloudevents/sdk-go/legacy/pkg/binding/test"
|
"github.com/cloudevents/sdk-go/v1/binding/test"
|
||||||
"github.com/cloudevents/sdk-go/legacy/pkg/cloudevents/types"
|
"github.com/cloudevents/sdk-go/v1/cloudevents/types"
|
||||||
)
|
)
|
||||||
|
|
||||||
func TestAddAttribute(t *testing.T) {
|
func TestAddAttribute(t *testing.T) {
|
||||||
|
|
@ -1,9 +1,9 @@
|
||||||
package transcoder
|
package transcoder
|
||||||
|
|
||||||
import (
|
import (
|
||||||
cloudevents "github.com/cloudevents/sdk-go/legacy"
|
cloudevents "github.com/cloudevents/sdk-go/v1"
|
||||||
"github.com/cloudevents/sdk-go/legacy/pkg/binding"
|
"github.com/cloudevents/sdk-go/v1/binding"
|
||||||
"github.com/cloudevents/sdk-go/legacy/pkg/binding/spec"
|
"github.com/cloudevents/sdk-go/v1/binding/spec"
|
||||||
)
|
)
|
||||||
|
|
||||||
// Delete cloudevents attribute during the encoding process
|
// Delete cloudevents attribute during the encoding process
|
||||||
|
|
@ -7,9 +7,9 @@ import (
|
||||||
|
|
||||||
"github.com/stretchr/testify/require"
|
"github.com/stretchr/testify/require"
|
||||||
|
|
||||||
"github.com/cloudevents/sdk-go/legacy/pkg/binding"
|
"github.com/cloudevents/sdk-go/v1/binding"
|
||||||
"github.com/cloudevents/sdk-go/legacy/pkg/binding/spec"
|
"github.com/cloudevents/sdk-go/v1/binding/spec"
|
||||||
"github.com/cloudevents/sdk-go/legacy/pkg/binding/test"
|
"github.com/cloudevents/sdk-go/v1/binding/test"
|
||||||
)
|
)
|
||||||
|
|
||||||
func TestDeleteAttribute(t *testing.T) {
|
func TestDeleteAttribute(t *testing.T) {
|
||||||
|
|
@ -1,9 +1,9 @@
|
||||||
package transcoder
|
package transcoder
|
||||||
|
|
||||||
import (
|
import (
|
||||||
cloudevents "github.com/cloudevents/sdk-go/legacy"
|
cloudevents "github.com/cloudevents/sdk-go/v1"
|
||||||
"github.com/cloudevents/sdk-go/legacy/pkg/binding"
|
"github.com/cloudevents/sdk-go/v1/binding"
|
||||||
"github.com/cloudevents/sdk-go/legacy/pkg/binding/spec"
|
"github.com/cloudevents/sdk-go/v1/binding/spec"
|
||||||
)
|
)
|
||||||
|
|
||||||
// Update cloudevents attribute (if present) using the provided function during the encoding process
|
// Update cloudevents attribute (if present) using the provided function during the encoding process
|
||||||
|
|
@ -8,9 +8,9 @@ import (
|
||||||
|
|
||||||
"github.com/stretchr/testify/require"
|
"github.com/stretchr/testify/require"
|
||||||
|
|
||||||
"github.com/cloudevents/sdk-go/legacy/pkg/binding"
|
"github.com/cloudevents/sdk-go/v1/binding"
|
||||||
"github.com/cloudevents/sdk-go/legacy/pkg/binding/spec"
|
"github.com/cloudevents/sdk-go/v1/binding/spec"
|
||||||
"github.com/cloudevents/sdk-go/legacy/pkg/binding/test"
|
"github.com/cloudevents/sdk-go/v1/binding/test"
|
||||||
)
|
)
|
||||||
|
|
||||||
func TestUpdateAttribute(t *testing.T) {
|
func TestUpdateAttribute(t *testing.T) {
|
||||||
|
|
@ -1,9 +1,9 @@
|
||||||
package transcoder
|
package transcoder
|
||||||
|
|
||||||
import (
|
import (
|
||||||
"github.com/cloudevents/sdk-go/legacy/pkg/binding"
|
"github.com/cloudevents/sdk-go/v1/binding"
|
||||||
"github.com/cloudevents/sdk-go/legacy/pkg/binding/spec"
|
"github.com/cloudevents/sdk-go/v1/binding/spec"
|
||||||
ce "github.com/cloudevents/sdk-go/legacy/pkg/cloudevents"
|
ce "github.com/cloudevents/sdk-go/v1/cloudevents"
|
||||||
)
|
)
|
||||||
|
|
||||||
// Returns a TransformerFactory that converts the event context version to the specified one.
|
// Returns a TransformerFactory that converts the event context version to the specified one.
|
||||||
|
|
@ -7,11 +7,11 @@ import (
|
||||||
|
|
||||||
"github.com/stretchr/testify/require"
|
"github.com/stretchr/testify/require"
|
||||||
|
|
||||||
cloudevents "github.com/cloudevents/sdk-go/legacy"
|
cloudevents "github.com/cloudevents/sdk-go/v1"
|
||||||
"github.com/cloudevents/sdk-go/legacy/pkg/binding"
|
"github.com/cloudevents/sdk-go/v1/binding"
|
||||||
"github.com/cloudevents/sdk-go/legacy/pkg/binding/spec"
|
"github.com/cloudevents/sdk-go/v1/binding/spec"
|
||||||
"github.com/cloudevents/sdk-go/legacy/pkg/binding/test"
|
"github.com/cloudevents/sdk-go/v1/binding/test"
|
||||||
"github.com/cloudevents/sdk-go/legacy/pkg/cloudevents/types"
|
"github.com/cloudevents/sdk-go/v1/cloudevents/types"
|
||||||
)
|
)
|
||||||
|
|
||||||
func TestVersionTranscoder(t *testing.T) {
|
func TestVersionTranscoder(t *testing.T) {
|
||||||
|
|
@ -4,7 +4,7 @@ import (
|
||||||
"context"
|
"context"
|
||||||
"errors"
|
"errors"
|
||||||
|
|
||||||
ce "github.com/cloudevents/sdk-go/legacy"
|
ce "github.com/cloudevents/sdk-go/v1"
|
||||||
)
|
)
|
||||||
|
|
||||||
const (
|
const (
|
||||||
|
|
@ -4,8 +4,8 @@ import (
|
||||||
"context"
|
"context"
|
||||||
"io"
|
"io"
|
||||||
|
|
||||||
ce "github.com/cloudevents/sdk-go/legacy/pkg/cloudevents"
|
ce "github.com/cloudevents/sdk-go/v1/cloudevents"
|
||||||
"github.com/cloudevents/sdk-go/legacy/pkg/cloudevents/transport"
|
"github.com/cloudevents/sdk-go/v1/cloudevents/transport"
|
||||||
)
|
)
|
||||||
|
|
||||||
// BindingTransport implements transport.Transport using a Sender and Receiver.
|
// BindingTransport implements transport.Transport using a Sender and Receiver.
|
||||||
|
|
@ -6,9 +6,9 @@ import (
|
||||||
|
|
||||||
"github.com/stretchr/testify/require"
|
"github.com/stretchr/testify/require"
|
||||||
|
|
||||||
cloudevents "github.com/cloudevents/sdk-go/legacy"
|
cloudevents "github.com/cloudevents/sdk-go/v1"
|
||||||
"github.com/cloudevents/sdk-go/legacy/pkg/binding"
|
"github.com/cloudevents/sdk-go/v1/binding"
|
||||||
"github.com/cloudevents/sdk-go/legacy/pkg/binding/test"
|
"github.com/cloudevents/sdk-go/v1/binding/test"
|
||||||
)
|
)
|
||||||
|
|
||||||
func TestTransportSend(t *testing.T) {
|
func TestTransportSend(t *testing.T) {
|
||||||
|
|
@ -13,9 +13,9 @@ import (
|
||||||
"github.com/stretchr/testify/require"
|
"github.com/stretchr/testify/require"
|
||||||
"pack.ag/amqp"
|
"pack.ag/amqp"
|
||||||
|
|
||||||
"github.com/cloudevents/sdk-go/legacy/pkg/binding"
|
"github.com/cloudevents/sdk-go/v1/binding"
|
||||||
"github.com/cloudevents/sdk-go/legacy/pkg/binding/test"
|
"github.com/cloudevents/sdk-go/v1/binding/test"
|
||||||
ce "github.com/cloudevents/sdk-go/legacy/pkg/cloudevents"
|
ce "github.com/cloudevents/sdk-go/v1/cloudevents"
|
||||||
)
|
)
|
||||||
|
|
||||||
func TestSendSkipBinary(t *testing.T) {
|
func TestSendSkipBinary(t *testing.T) {
|
||||||
|
|
@ -7,10 +7,10 @@ import (
|
||||||
|
|
||||||
"pack.ag/amqp"
|
"pack.ag/amqp"
|
||||||
|
|
||||||
"github.com/cloudevents/sdk-go/legacy/pkg/binding"
|
"github.com/cloudevents/sdk-go/v1/binding"
|
||||||
"github.com/cloudevents/sdk-go/legacy/pkg/binding/format"
|
"github.com/cloudevents/sdk-go/v1/binding/format"
|
||||||
"github.com/cloudevents/sdk-go/legacy/pkg/binding/spec"
|
"github.com/cloudevents/sdk-go/v1/binding/spec"
|
||||||
"github.com/cloudevents/sdk-go/legacy/pkg/cloudevents/types"
|
"github.com/cloudevents/sdk-go/v1/cloudevents/types"
|
||||||
)
|
)
|
||||||
|
|
||||||
// Fill the provided amqpMessage with the message m.
|
// Fill the provided amqpMessage with the message m.
|
||||||
|
|
@ -9,9 +9,9 @@ import (
|
||||||
|
|
||||||
"pack.ag/amqp"
|
"pack.ag/amqp"
|
||||||
|
|
||||||
"github.com/cloudevents/sdk-go/legacy/pkg/binding"
|
"github.com/cloudevents/sdk-go/v1/binding"
|
||||||
"github.com/cloudevents/sdk-go/legacy/pkg/binding/format"
|
"github.com/cloudevents/sdk-go/v1/binding/format"
|
||||||
"github.com/cloudevents/sdk-go/legacy/pkg/binding/spec"
|
"github.com/cloudevents/sdk-go/v1/binding/spec"
|
||||||
)
|
)
|
||||||
|
|
||||||
const prefix = "cloudEvents:" // Name prefix for AMQP properties that hold CE attributes.
|
const prefix = "cloudEvents:" // Name prefix for AMQP properties that hold CE attributes.
|
||||||
|
|
@ -1,6 +1,6 @@
|
||||||
package amqp
|
package amqp
|
||||||
|
|
||||||
import "github.com/cloudevents/sdk-go/legacy/pkg/binding"
|
import "github.com/cloudevents/sdk-go/v1/binding"
|
||||||
|
|
||||||
type SenderOptionFunc func(sender *Sender)
|
type SenderOptionFunc func(sender *Sender)
|
||||||
|
|
||||||
|
|
@ -3,7 +3,7 @@ package amqp
|
||||||
import (
|
import (
|
||||||
"context"
|
"context"
|
||||||
|
|
||||||
"github.com/cloudevents/sdk-go/legacy/pkg/binding"
|
"github.com/cloudevents/sdk-go/v1/binding"
|
||||||
"pack.ag/amqp"
|
"pack.ag/amqp"
|
||||||
)
|
)
|
||||||
|
|
||||||
|
|
@ -5,7 +5,7 @@ import (
|
||||||
|
|
||||||
"pack.ag/amqp"
|
"pack.ag/amqp"
|
||||||
|
|
||||||
"github.com/cloudevents/sdk-go/legacy/pkg/binding"
|
"github.com/cloudevents/sdk-go/v1/binding"
|
||||||
)
|
)
|
||||||
|
|
||||||
// Sender wraps an amqp.Sender as a binding.Sender
|
// Sender wraps an amqp.Sender as a binding.Sender
|
||||||
|
|
@ -1,6 +1,6 @@
|
||||||
package amqp
|
package amqp
|
||||||
|
|
||||||
import "github.com/cloudevents/sdk-go/legacy/pkg/cloudevents/types"
|
import "github.com/cloudevents/sdk-go/v1/cloudevents/types"
|
||||||
|
|
||||||
func safeAMQPPropertiesUnwrap(val interface{}) (interface{}, error) {
|
func safeAMQPPropertiesUnwrap(val interface{}) (interface{}, error) {
|
||||||
v, err := types.Validate(val)
|
v, err := types.Validate(val)
|
||||||
|
|
@ -10,10 +10,10 @@ import (
|
||||||
"github.com/stretchr/testify/assert"
|
"github.com/stretchr/testify/assert"
|
||||||
"github.com/stretchr/testify/require"
|
"github.com/stretchr/testify/require"
|
||||||
|
|
||||||
"github.com/cloudevents/sdk-go/legacy/pkg/binding"
|
"github.com/cloudevents/sdk-go/v1/binding"
|
||||||
"github.com/cloudevents/sdk-go/legacy/pkg/binding/test"
|
"github.com/cloudevents/sdk-go/v1/binding/test"
|
||||||
"github.com/cloudevents/sdk-go/legacy/pkg/bindings/http"
|
"github.com/cloudevents/sdk-go/v1/bindings/http"
|
||||||
ce "github.com/cloudevents/sdk-go/legacy/pkg/cloudevents"
|
ce "github.com/cloudevents/sdk-go/v1/cloudevents"
|
||||||
)
|
)
|
||||||
|
|
||||||
func TestSendSkipBinary(t *testing.T) {
|
func TestSendSkipBinary(t *testing.T) {
|
||||||
|
|
@ -6,9 +6,9 @@ import (
|
||||||
nethttp "net/http"
|
nethttp "net/http"
|
||||||
"strings"
|
"strings"
|
||||||
|
|
||||||
"github.com/cloudevents/sdk-go/legacy/pkg/binding"
|
"github.com/cloudevents/sdk-go/v1/binding"
|
||||||
"github.com/cloudevents/sdk-go/legacy/pkg/binding/format"
|
"github.com/cloudevents/sdk-go/v1/binding/format"
|
||||||
"github.com/cloudevents/sdk-go/legacy/pkg/binding/spec"
|
"github.com/cloudevents/sdk-go/v1/binding/spec"
|
||||||
)
|
)
|
||||||
|
|
||||||
const prefix = "Ce-"
|
const prefix = "Ce-"
|
||||||
|
|
@ -1,6 +1,6 @@
|
||||||
package http
|
package http
|
||||||
|
|
||||||
import "github.com/cloudevents/sdk-go/legacy/pkg/binding"
|
import "github.com/cloudevents/sdk-go/v1/binding"
|
||||||
|
|
||||||
type SenderOptionFunc func(sender *Sender)
|
type SenderOptionFunc func(sender *Sender)
|
||||||
|
|
||||||
|
|
@ -7,7 +7,7 @@ import (
|
||||||
"net/http"
|
"net/http"
|
||||||
nethttp "net/http"
|
nethttp "net/http"
|
||||||
|
|
||||||
"github.com/cloudevents/sdk-go/legacy/pkg/binding"
|
"github.com/cloudevents/sdk-go/v1/binding"
|
||||||
)
|
)
|
||||||
|
|
||||||
type msgErr struct {
|
type msgErr struct {
|
||||||
|
|
@ -6,10 +6,10 @@ import (
|
||||||
"io/ioutil"
|
"io/ioutil"
|
||||||
"net/http"
|
"net/http"
|
||||||
|
|
||||||
"github.com/cloudevents/sdk-go/legacy/pkg/binding"
|
"github.com/cloudevents/sdk-go/v1/binding"
|
||||||
"github.com/cloudevents/sdk-go/legacy/pkg/binding/format"
|
"github.com/cloudevents/sdk-go/v1/binding/format"
|
||||||
"github.com/cloudevents/sdk-go/legacy/pkg/binding/spec"
|
"github.com/cloudevents/sdk-go/v1/binding/spec"
|
||||||
"github.com/cloudevents/sdk-go/legacy/pkg/cloudevents/types"
|
"github.com/cloudevents/sdk-go/v1/cloudevents/types"
|
||||||
)
|
)
|
||||||
|
|
||||||
// Fill the provided req with the message m.
|
// Fill the provided req with the message m.
|
||||||
|
|
@ -6,10 +6,10 @@ import (
|
||||||
"io/ioutil"
|
"io/ioutil"
|
||||||
"net/http"
|
"net/http"
|
||||||
|
|
||||||
"github.com/cloudevents/sdk-go/legacy/pkg/binding"
|
"github.com/cloudevents/sdk-go/v1/binding"
|
||||||
"github.com/cloudevents/sdk-go/legacy/pkg/binding/format"
|
"github.com/cloudevents/sdk-go/v1/binding/format"
|
||||||
"github.com/cloudevents/sdk-go/legacy/pkg/binding/spec"
|
"github.com/cloudevents/sdk-go/v1/binding/spec"
|
||||||
"github.com/cloudevents/sdk-go/legacy/pkg/cloudevents/types"
|
"github.com/cloudevents/sdk-go/v1/cloudevents/types"
|
||||||
)
|
)
|
||||||
|
|
||||||
// Fill the provided res with the message m.
|
// Fill the provided res with the message m.
|
||||||
|
|
@ -8,10 +8,10 @@ import (
|
||||||
|
|
||||||
"net/http"
|
"net/http"
|
||||||
|
|
||||||
cloudevents "github.com/cloudevents/sdk-go/legacy"
|
cloudevents "github.com/cloudevents/sdk-go/v1"
|
||||||
"github.com/cloudevents/sdk-go/legacy/pkg/binding"
|
"github.com/cloudevents/sdk-go/v1/binding"
|
||||||
"github.com/cloudevents/sdk-go/legacy/pkg/binding/test"
|
"github.com/cloudevents/sdk-go/v1/binding/test"
|
||||||
ce "github.com/cloudevents/sdk-go/legacy/pkg/cloudevents"
|
ce "github.com/cloudevents/sdk-go/v1/cloudevents"
|
||||||
)
|
)
|
||||||
|
|
||||||
func TestEncodeHttpResponse(t *testing.T) {
|
func TestEncodeHttpResponse(t *testing.T) {
|
||||||
|
|
@ -7,7 +7,7 @@ import (
|
||||||
nethttp "net/http"
|
nethttp "net/http"
|
||||||
"net/url"
|
"net/url"
|
||||||
|
|
||||||
"github.com/cloudevents/sdk-go/legacy/pkg/binding"
|
"github.com/cloudevents/sdk-go/v1/binding"
|
||||||
)
|
)
|
||||||
|
|
||||||
type Sender struct {
|
type Sender struct {
|
||||||
|
|
@ -14,9 +14,9 @@ import (
|
||||||
|
|
||||||
"github.com/Shopify/sarama"
|
"github.com/Shopify/sarama"
|
||||||
|
|
||||||
cloudevents "github.com/cloudevents/sdk-go/legacy"
|
cloudevents "github.com/cloudevents/sdk-go/v1"
|
||||||
"github.com/cloudevents/sdk-go/legacy/pkg/binding"
|
"github.com/cloudevents/sdk-go/v1/binding"
|
||||||
"github.com/cloudevents/sdk-go/legacy/pkg/binding/test"
|
"github.com/cloudevents/sdk-go/v1/binding/test"
|
||||||
)
|
)
|
||||||
|
|
||||||
const (
|
const (
|
||||||
|
|
@ -5,10 +5,10 @@ import (
|
||||||
"context"
|
"context"
|
||||||
"strings"
|
"strings"
|
||||||
|
|
||||||
ce "github.com/cloudevents/sdk-go/legacy"
|
ce "github.com/cloudevents/sdk-go/v1"
|
||||||
"github.com/cloudevents/sdk-go/legacy/pkg/binding"
|
"github.com/cloudevents/sdk-go/v1/binding"
|
||||||
"github.com/cloudevents/sdk-go/legacy/pkg/binding/format"
|
"github.com/cloudevents/sdk-go/v1/binding/format"
|
||||||
"github.com/cloudevents/sdk-go/legacy/pkg/binding/spec"
|
"github.com/cloudevents/sdk-go/v1/binding/spec"
|
||||||
|
|
||||||
"github.com/Shopify/sarama"
|
"github.com/Shopify/sarama"
|
||||||
)
|
)
|
||||||
|
|
@ -6,9 +6,9 @@ import (
|
||||||
"context"
|
"context"
|
||||||
"testing"
|
"testing"
|
||||||
|
|
||||||
cloudevents "github.com/cloudevents/sdk-go/legacy"
|
cloudevents "github.com/cloudevents/sdk-go/v1"
|
||||||
"github.com/cloudevents/sdk-go/legacy/pkg/binding"
|
"github.com/cloudevents/sdk-go/v1/binding"
|
||||||
"github.com/cloudevents/sdk-go/legacy/pkg/bindings/kafka_sarama"
|
"github.com/cloudevents/sdk-go/v1/bindings/kafka_sarama"
|
||||||
)
|
)
|
||||||
|
|
||||||
// Avoid DCE
|
// Avoid DCE
|
||||||
|
|
@ -1,6 +1,6 @@
|
||||||
package kafka_sarama
|
package kafka_sarama
|
||||||
|
|
||||||
import "github.com/cloudevents/sdk-go/legacy/pkg/binding"
|
import "github.com/cloudevents/sdk-go/v1/binding"
|
||||||
|
|
||||||
type SenderOptionFunc func(sender *Sender)
|
type SenderOptionFunc func(sender *Sender)
|
||||||
|
|
||||||
|
|
@ -7,11 +7,11 @@ import (
|
||||||
|
|
||||||
"github.com/Shopify/sarama"
|
"github.com/Shopify/sarama"
|
||||||
|
|
||||||
ce "github.com/cloudevents/sdk-go/legacy"
|
ce "github.com/cloudevents/sdk-go/v1"
|
||||||
"github.com/cloudevents/sdk-go/legacy/pkg/binding"
|
"github.com/cloudevents/sdk-go/v1/binding"
|
||||||
"github.com/cloudevents/sdk-go/legacy/pkg/binding/format"
|
"github.com/cloudevents/sdk-go/v1/binding/format"
|
||||||
"github.com/cloudevents/sdk-go/legacy/pkg/binding/spec"
|
"github.com/cloudevents/sdk-go/v1/binding/spec"
|
||||||
"github.com/cloudevents/sdk-go/legacy/pkg/cloudevents/types"
|
"github.com/cloudevents/sdk-go/v1/cloudevents/types"
|
||||||
)
|
)
|
||||||
|
|
||||||
const (
|
const (
|
||||||
|
|
@ -8,10 +8,10 @@ import (
|
||||||
|
|
||||||
"github.com/Shopify/sarama"
|
"github.com/Shopify/sarama"
|
||||||
|
|
||||||
cloudevents "github.com/cloudevents/sdk-go/legacy"
|
cloudevents "github.com/cloudevents/sdk-go/v1"
|
||||||
"github.com/cloudevents/sdk-go/legacy/pkg/binding"
|
"github.com/cloudevents/sdk-go/v1/binding"
|
||||||
"github.com/cloudevents/sdk-go/legacy/pkg/binding/test"
|
"github.com/cloudevents/sdk-go/v1/binding/test"
|
||||||
"github.com/cloudevents/sdk-go/legacy/pkg/bindings/kafka_sarama"
|
"github.com/cloudevents/sdk-go/v1/bindings/kafka_sarama"
|
||||||
)
|
)
|
||||||
|
|
||||||
// Avoid DCE
|
// Avoid DCE
|
||||||
|
|
@ -10,10 +10,10 @@ import (
|
||||||
"github.com/Shopify/sarama"
|
"github.com/Shopify/sarama"
|
||||||
"github.com/stretchr/testify/require"
|
"github.com/stretchr/testify/require"
|
||||||
|
|
||||||
cloudevents "github.com/cloudevents/sdk-go/legacy"
|
cloudevents "github.com/cloudevents/sdk-go/v1"
|
||||||
"github.com/cloudevents/sdk-go/legacy/pkg/binding"
|
"github.com/cloudevents/sdk-go/v1/binding"
|
||||||
"github.com/cloudevents/sdk-go/legacy/pkg/binding/test"
|
"github.com/cloudevents/sdk-go/v1/binding/test"
|
||||||
ce "github.com/cloudevents/sdk-go/legacy/pkg/cloudevents"
|
ce "github.com/cloudevents/sdk-go/v1/cloudevents"
|
||||||
)
|
)
|
||||||
|
|
||||||
func TestEncodeKafkaProducerMessage(t *testing.T) {
|
func TestEncodeKafkaProducerMessage(t *testing.T) {
|
||||||
|
|
@ -6,7 +6,7 @@ import (
|
||||||
|
|
||||||
"github.com/Shopify/sarama"
|
"github.com/Shopify/sarama"
|
||||||
|
|
||||||
"github.com/cloudevents/sdk-go/legacy/pkg/binding"
|
"github.com/cloudevents/sdk-go/v1/binding"
|
||||||
)
|
)
|
||||||
|
|
||||||
type msgErr struct {
|
type msgErr struct {
|
||||||
|
|
@ -5,7 +5,7 @@ import (
|
||||||
|
|
||||||
"github.com/Shopify/sarama"
|
"github.com/Shopify/sarama"
|
||||||
|
|
||||||
"github.com/cloudevents/sdk-go/legacy/pkg/binding"
|
"github.com/cloudevents/sdk-go/v1/binding"
|
||||||
)
|
)
|
||||||
|
|
||||||
type Sender struct {
|
type Sender struct {
|
||||||
|
|
@ -5,11 +5,11 @@ import (
|
||||||
"fmt"
|
"fmt"
|
||||||
"sync"
|
"sync"
|
||||||
|
|
||||||
"github.com/cloudevents/sdk-go/legacy/pkg/cloudevents"
|
"github.com/cloudevents/sdk-go/v1/cloudevents"
|
||||||
"github.com/cloudevents/sdk-go/legacy/pkg/cloudevents/extensions"
|
"github.com/cloudevents/sdk-go/v1/cloudevents/extensions"
|
||||||
"github.com/cloudevents/sdk-go/legacy/pkg/cloudevents/observability"
|
"github.com/cloudevents/sdk-go/v1/cloudevents/observability"
|
||||||
"github.com/cloudevents/sdk-go/legacy/pkg/cloudevents/transport"
|
"github.com/cloudevents/sdk-go/v1/cloudevents/transport"
|
||||||
"github.com/cloudevents/sdk-go/legacy/pkg/cloudevents/transport/http"
|
"github.com/cloudevents/sdk-go/v1/cloudevents/transport/http"
|
||||||
"go.opencensus.io/trace"
|
"go.opencensus.io/trace"
|
||||||
)
|
)
|
||||||
|
|
||||||
|
|
@ -12,10 +12,10 @@ import (
|
||||||
"testing"
|
"testing"
|
||||||
"time"
|
"time"
|
||||||
|
|
||||||
"github.com/cloudevents/sdk-go/legacy/pkg/cloudevents"
|
"github.com/cloudevents/sdk-go/v1/cloudevents"
|
||||||
"github.com/cloudevents/sdk-go/legacy/pkg/cloudevents/client"
|
"github.com/cloudevents/sdk-go/v1/cloudevents/client"
|
||||||
cehttp "github.com/cloudevents/sdk-go/legacy/pkg/cloudevents/transport/http"
|
cehttp "github.com/cloudevents/sdk-go/v1/cloudevents/transport/http"
|
||||||
"github.com/cloudevents/sdk-go/legacy/pkg/cloudevents/types"
|
"github.com/cloudevents/sdk-go/v1/cloudevents/types"
|
||||||
"github.com/lightstep/tracecontext.go/traceparent"
|
"github.com/lightstep/tracecontext.go/traceparent"
|
||||||
"go.opencensus.io/trace"
|
"go.opencensus.io/trace"
|
||||||
|
|
||||||
|
|
@ -4,7 +4,7 @@ import (
|
||||||
"context"
|
"context"
|
||||||
"time"
|
"time"
|
||||||
|
|
||||||
"github.com/cloudevents/sdk-go/legacy/pkg/cloudevents"
|
"github.com/cloudevents/sdk-go/v1/cloudevents"
|
||||||
"github.com/google/uuid"
|
"github.com/google/uuid"
|
||||||
)
|
)
|
||||||
|
|
||||||
|
|
@ -5,7 +5,7 @@ import (
|
||||||
"testing"
|
"testing"
|
||||||
"time"
|
"time"
|
||||||
|
|
||||||
"github.com/cloudevents/sdk-go/legacy/pkg/cloudevents"
|
"github.com/cloudevents/sdk-go/v1/cloudevents"
|
||||||
"github.com/google/go-cmp/cmp"
|
"github.com/google/go-cmp/cmp"
|
||||||
)
|
)
|
||||||
|
|
||||||
|
|
@ -1,8 +1,8 @@
|
||||||
package client
|
package client
|
||||||
|
|
||||||
import (
|
import (
|
||||||
"github.com/cloudevents/sdk-go/legacy/pkg/cloudevents"
|
"github.com/cloudevents/sdk-go/v1/cloudevents"
|
||||||
"github.com/cloudevents/sdk-go/legacy/pkg/cloudevents/observability"
|
"github.com/cloudevents/sdk-go/v1/cloudevents/observability"
|
||||||
"go.opencensus.io/stats"
|
"go.opencensus.io/stats"
|
||||||
"go.opencensus.io/stats/view"
|
"go.opencensus.io/stats/view"
|
||||||
"go.opencensus.io/trace"
|
"go.opencensus.io/trace"
|
||||||
|
|
@ -4,7 +4,7 @@ import (
|
||||||
"context"
|
"context"
|
||||||
"testing"
|
"testing"
|
||||||
|
|
||||||
"github.com/cloudevents/sdk-go/legacy/pkg/cloudevents"
|
"github.com/cloudevents/sdk-go/v1/cloudevents"
|
||||||
"github.com/google/go-cmp/cmp"
|
"github.com/google/go-cmp/cmp"
|
||||||
)
|
)
|
||||||
|
|
||||||
|
|
@ -6,8 +6,8 @@ import (
|
||||||
"fmt"
|
"fmt"
|
||||||
"reflect"
|
"reflect"
|
||||||
|
|
||||||
"github.com/cloudevents/sdk-go/legacy/pkg/cloudevents"
|
"github.com/cloudevents/sdk-go/v1/cloudevents"
|
||||||
"github.com/cloudevents/sdk-go/legacy/pkg/cloudevents/transport"
|
"github.com/cloudevents/sdk-go/v1/cloudevents/transport"
|
||||||
)
|
)
|
||||||
|
|
||||||
// Receive is the signature of a fn to be invoked for incoming cloudevents.
|
// Receive is the signature of a fn to be invoked for incoming cloudevents.
|
||||||
|
|
@ -5,7 +5,7 @@ import (
|
||||||
"errors"
|
"errors"
|
||||||
"testing"
|
"testing"
|
||||||
|
|
||||||
"github.com/cloudevents/sdk-go/legacy/pkg/cloudevents"
|
"github.com/cloudevents/sdk-go/v1/cloudevents"
|
||||||
"github.com/google/go-cmp/cmp"
|
"github.com/google/go-cmp/cmp"
|
||||||
)
|
)
|
||||||
|
|
||||||
|
|
@ -3,7 +3,7 @@ package cloudevents_test
|
||||||
import (
|
import (
|
||||||
"testing"
|
"testing"
|
||||||
|
|
||||||
ce "github.com/cloudevents/sdk-go/legacy/pkg/cloudevents"
|
ce "github.com/cloudevents/sdk-go/v1/cloudevents"
|
||||||
"github.com/google/go-cmp/cmp"
|
"github.com/google/go-cmp/cmp"
|
||||||
)
|
)
|
||||||
|
|
||||||
|
|
@ -5,7 +5,7 @@ import (
|
||||||
"net/url"
|
"net/url"
|
||||||
"testing"
|
"testing"
|
||||||
|
|
||||||
cecontext "github.com/cloudevents/sdk-go/legacy/pkg/cloudevents/context"
|
cecontext "github.com/cloudevents/sdk-go/v1/cloudevents/context"
|
||||||
"github.com/google/go-cmp/cmp"
|
"github.com/google/go-cmp/cmp"
|
||||||
)
|
)
|
||||||
|
|
||||||
|
|
@ -3,7 +3,7 @@ package cloudevents_test
|
||||||
import (
|
import (
|
||||||
"testing"
|
"testing"
|
||||||
|
|
||||||
ce "github.com/cloudevents/sdk-go/legacy/pkg/cloudevents"
|
ce "github.com/cloudevents/sdk-go/v1/cloudevents"
|
||||||
"github.com/google/go-cmp/cmp"
|
"github.com/google/go-cmp/cmp"
|
||||||
)
|
)
|
||||||
|
|
||||||
|
|
@ -4,10 +4,10 @@ import (
|
||||||
"context"
|
"context"
|
||||||
"fmt"
|
"fmt"
|
||||||
|
|
||||||
"github.com/cloudevents/sdk-go/legacy/pkg/cloudevents/datacodec/json"
|
"github.com/cloudevents/sdk-go/v1/cloudevents/datacodec/json"
|
||||||
"github.com/cloudevents/sdk-go/legacy/pkg/cloudevents/datacodec/text"
|
"github.com/cloudevents/sdk-go/v1/cloudevents/datacodec/text"
|
||||||
"github.com/cloudevents/sdk-go/legacy/pkg/cloudevents/datacodec/xml"
|
"github.com/cloudevents/sdk-go/v1/cloudevents/datacodec/xml"
|
||||||
"github.com/cloudevents/sdk-go/legacy/pkg/cloudevents/observability"
|
"github.com/cloudevents/sdk-go/v1/cloudevents/observability"
|
||||||
)
|
)
|
||||||
|
|
||||||
// Decoder is the expected function signature for decoding `in` to `out`. What
|
// Decoder is the expected function signature for decoding `in` to `out`. What
|
||||||
|
|
@ -6,8 +6,8 @@ import (
|
||||||
"strings"
|
"strings"
|
||||||
"testing"
|
"testing"
|
||||||
|
|
||||||
"github.com/cloudevents/sdk-go/legacy/pkg/cloudevents/datacodec"
|
"github.com/cloudevents/sdk-go/v1/cloudevents/datacodec"
|
||||||
"github.com/cloudevents/sdk-go/legacy/pkg/cloudevents/types"
|
"github.com/cloudevents/sdk-go/v1/cloudevents/types"
|
||||||
"github.com/google/go-cmp/cmp"
|
"github.com/google/go-cmp/cmp"
|
||||||
)
|
)
|
||||||
|
|
||||||
|
|
@ -7,7 +7,7 @@ import (
|
||||||
"reflect"
|
"reflect"
|
||||||
"strconv"
|
"strconv"
|
||||||
|
|
||||||
"github.com/cloudevents/sdk-go/legacy/pkg/cloudevents/observability"
|
"github.com/cloudevents/sdk-go/v1/cloudevents/observability"
|
||||||
)
|
)
|
||||||
|
|
||||||
// Decode takes `in` as []byte, or base64 string, normalizes in to unquoted and
|
// Decode takes `in` as []byte, or base64 string, normalizes in to unquoted and
|
||||||
|
|
@ -7,8 +7,8 @@ import (
|
||||||
"testing"
|
"testing"
|
||||||
"time"
|
"time"
|
||||||
|
|
||||||
cej "github.com/cloudevents/sdk-go/legacy/pkg/cloudevents/datacodec/json"
|
cej "github.com/cloudevents/sdk-go/v1/cloudevents/datacodec/json"
|
||||||
"github.com/cloudevents/sdk-go/legacy/pkg/cloudevents/types"
|
"github.com/cloudevents/sdk-go/v1/cloudevents/types"
|
||||||
"github.com/google/go-cmp/cmp"
|
"github.com/google/go-cmp/cmp"
|
||||||
)
|
)
|
||||||
|
|
||||||
Some files were not shown because too many files have changed in this diff Show More
Loading…
Reference in New Issue