Skip to content

Commit

Permalink
Added a Gin http receiver sample
Browse files Browse the repository at this point in the history
Signed-off-by: Dimitar Georgievski <dgeorgievski@gmail.com>
  • Loading branch information
dgeorgievski committed May 31, 2023
1 parent b7a65db commit 215ea79
Show file tree
Hide file tree
Showing 6 changed files with 301 additions and 9 deletions.
1 change: 1 addition & 0 deletions samples/README.md
Original file line number Diff line number Diff line change
Expand Up @@ -11,6 +11,7 @@ You can grab them and copy-paste in your project to start using sdk-go.
* HTTP:
* [Receiver](./http/receiver): Receive events using the CloudEvents Client.
* [Direct receiver](./http/receiver-direct): Create an `http.Handler` to receive events without the CloudEvents Client.
* [Gin Gonic receiver](./http/receiver-gin): Receive events using [Gin Gonic](https://gin-gonic.com/).
* [Gorilla receiver](./http/receiver-gorilla): Receive events using [Gorilla](https://www.gorillatoolkit.org/).
* [Sleepy receiver](./http/receiver-sleepy): Receive events for 5 seconds, then stop the receiver.
* [Traced receiver](./http/receiver-traced): Receive events enabling tracing.
Expand Down
22 changes: 18 additions & 4 deletions samples/http/go.mod
Original file line number Diff line number Diff line change
Expand Up @@ -8,43 +8,57 @@ require (
github.com/cloudevents/sdk-go/observability/opencensus/v2 v2.5.0
github.com/cloudevents/sdk-go/observability/opentelemetry/v2 v2.5.0
github.com/cloudevents/sdk-go/v2 v2.5.0
github.com/gin-gonic/gin v1.8.2
github.com/google/uuid v1.1.1
github.com/gorilla/mux v1.7.3
github.com/kelseyhightower/envconfig v1.4.0
github.com/rs/zerolog v1.29.0
go.opencensus.io v0.22.3
go.opentelemetry.io/contrib/instrumentation/net/http/otelhttp v0.23.0
go.opentelemetry.io/otel v1.0.0
go.opentelemetry.io/otel/exporters/jaeger v1.0.0
go.opentelemetry.io/otel/sdk v1.0.0
go.opentelemetry.io/otel/trace v1.0.0
google.golang.org/protobuf v1.26.0
google.golang.org/protobuf v1.28.1
)

require (
github.com/beorn7/perks v1.0.1 // indirect
github.com/cespare/xxhash/v2 v2.1.1 // indirect
github.com/felixge/httpsnoop v1.0.2 // indirect
github.com/gin-contrib/sse v0.1.0 // indirect
github.com/go-playground/locales v0.14.0 // indirect
github.com/go-playground/universal-translator v0.18.0 // indirect
github.com/go-playground/validator/v10 v10.11.1 // indirect
github.com/goccy/go-json v0.9.11 // indirect
github.com/golang/groupcache v0.0.0-20190702054246-869f871628b6 // indirect
github.com/golang/protobuf v1.5.0 // indirect
github.com/json-iterator/go v1.1.11 // indirect
github.com/json-iterator/go v1.1.12 // indirect
github.com/leodido/go-urn v1.2.1 // indirect
github.com/mattn/go-colorable v0.1.12 // indirect
github.com/mattn/go-isatty v0.0.16 // indirect
github.com/matttproud/golang_protobuf_extensions v1.0.1 // indirect
github.com/modern-go/concurrent v0.0.0-20180306012644-bacd9c7ef1dd // indirect
github.com/modern-go/reflect2 v1.0.1 // indirect
github.com/modern-go/reflect2 v1.0.2 // indirect
github.com/pelletier/go-toml/v2 v2.0.6 // indirect
github.com/prometheus/client_golang v1.11.1 // indirect
github.com/prometheus/client_model v0.2.0 // indirect
github.com/prometheus/common v0.26.0 // indirect
github.com/prometheus/procfs v0.6.0 // indirect
github.com/stretchr/objx v0.4.0 // indirect
github.com/ugorji/go/codec v1.2.7 // indirect
go.opentelemetry.io/contrib v0.23.0 // indirect
go.opentelemetry.io/otel/internal/metric v0.23.0 // indirect
go.opentelemetry.io/otel/metric v0.23.0 // indirect
go.uber.org/atomic v1.4.0 // indirect
go.uber.org/multierr v1.1.0 // indirect
go.uber.org/zap v1.10.0 // indirect
golang.org/x/crypto v0.0.0-20211215153901-e495a2d5b3d3 // indirect
golang.org/x/net v0.7.0 // indirect
golang.org/x/sys v0.5.0 // indirect
golang.org/x/text v0.7.0 // indirect
google.golang.org/genproto v0.0.0-20190425155659-357c62f0e4bb // indirect
google.golang.org/grpc v1.20.1 // indirect
gopkg.in/yaml.v2 v2.4.0 // indirect
)

replace github.com/cloudevents/sdk-go/v2 => ../../v2
Expand Down

0 comments on commit 215ea79

Please sign in to comment.