Skip to content

Commit 9970acc

Browse files
authored
Added a Gin http receiver sample (#842)
Signed-off-by: Dimitar Georgievski <dgeorgievski@gmail.com>
1 parent b7a65db commit 9970acc

File tree

6 files changed

+301
-9
lines changed

6 files changed

+301
-9
lines changed

samples/README.md

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -11,6 +11,7 @@ You can grab them and copy-paste in your project to start using sdk-go.
1111
* HTTP:
1212
* [Receiver](./http/receiver): Receive events using the CloudEvents Client.
1313
* [Direct receiver](./http/receiver-direct): Create an `http.Handler` to receive events without the CloudEvents Client.
14+
* [Gin Gonic receiver](./http/receiver-gin): Receive events using [Gin Gonic](https://gin-gonic.com/).
1415
* [Gorilla receiver](./http/receiver-gorilla): Receive events using [Gorilla](https://www.gorillatoolkit.org/).
1516
* [Sleepy receiver](./http/receiver-sleepy): Receive events for 5 seconds, then stop the receiver.
1617
* [Traced receiver](./http/receiver-traced): Receive events enabling tracing.

samples/http/go.mod

Lines changed: 18 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -8,43 +8,57 @@ require (
88
github.com/cloudevents/sdk-go/observability/opencensus/v2 v2.5.0
99
github.com/cloudevents/sdk-go/observability/opentelemetry/v2 v2.5.0
1010
github.com/cloudevents/sdk-go/v2 v2.5.0
11+
github.com/gin-gonic/gin v1.8.2
1112
github.com/google/uuid v1.1.1
1213
github.com/gorilla/mux v1.7.3
1314
github.com/kelseyhightower/envconfig v1.4.0
15+
github.com/rs/zerolog v1.29.0
1416
go.opencensus.io v0.22.3
1517
go.opentelemetry.io/contrib/instrumentation/net/http/otelhttp v0.23.0
1618
go.opentelemetry.io/otel v1.0.0
1719
go.opentelemetry.io/otel/exporters/jaeger v1.0.0
1820
go.opentelemetry.io/otel/sdk v1.0.0
1921
go.opentelemetry.io/otel/trace v1.0.0
20-
google.golang.org/protobuf v1.26.0
22+
google.golang.org/protobuf v1.28.1
2123
)
2224

2325
require (
2426
github.com/beorn7/perks v1.0.1 // indirect
2527
github.com/cespare/xxhash/v2 v2.1.1 // indirect
2628
github.com/felixge/httpsnoop v1.0.2 // indirect
29+
github.com/gin-contrib/sse v0.1.0 // indirect
30+
github.com/go-playground/locales v0.14.0 // indirect
31+
github.com/go-playground/universal-translator v0.18.0 // indirect
32+
github.com/go-playground/validator/v10 v10.11.1 // indirect
33+
github.com/goccy/go-json v0.9.11 // indirect
2734
github.com/golang/groupcache v0.0.0-20190702054246-869f871628b6 // indirect
2835
github.com/golang/protobuf v1.5.0 // indirect
29-
github.com/json-iterator/go v1.1.11 // indirect
36+
github.com/json-iterator/go v1.1.12 // indirect
37+
github.com/leodido/go-urn v1.2.1 // indirect
38+
github.com/mattn/go-colorable v0.1.12 // indirect
39+
github.com/mattn/go-isatty v0.0.16 // indirect
3040
github.com/matttproud/golang_protobuf_extensions v1.0.1 // indirect
3141
github.com/modern-go/concurrent v0.0.0-20180306012644-bacd9c7ef1dd // indirect
32-
github.com/modern-go/reflect2 v1.0.1 // indirect
42+
github.com/modern-go/reflect2 v1.0.2 // indirect
43+
github.com/pelletier/go-toml/v2 v2.0.6 // indirect
3344
github.com/prometheus/client_golang v1.11.1 // indirect
3445
github.com/prometheus/client_model v0.2.0 // indirect
3546
github.com/prometheus/common v0.26.0 // indirect
3647
github.com/prometheus/procfs v0.6.0 // indirect
37-
github.com/stretchr/objx v0.4.0 // indirect
48+
github.com/ugorji/go/codec v1.2.7 // indirect
3849
go.opentelemetry.io/contrib v0.23.0 // indirect
3950
go.opentelemetry.io/otel/internal/metric v0.23.0 // indirect
4051
go.opentelemetry.io/otel/metric v0.23.0 // indirect
4152
go.uber.org/atomic v1.4.0 // indirect
4253
go.uber.org/multierr v1.1.0 // indirect
4354
go.uber.org/zap v1.10.0 // indirect
55+
golang.org/x/crypto v0.0.0-20211215153901-e495a2d5b3d3 // indirect
56+
golang.org/x/net v0.7.0 // indirect
4457
golang.org/x/sys v0.5.0 // indirect
4558
golang.org/x/text v0.7.0 // indirect
4659
google.golang.org/genproto v0.0.0-20190425155659-357c62f0e4bb // indirect
4760
google.golang.org/grpc v1.20.1 // indirect
61+
gopkg.in/yaml.v2 v2.4.0 // indirect
4862
)
4963

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

0 commit comments

Comments
 (0)