Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

http: Added a Gin http receiver sample #842

Merged

Conversation

dgeorgievski
Copy link
Contributor

A simple example of a Gin http receiver for CloudEvents. The Gorilla/mux project is archived which makes the existing gorilla receiver example deprecated.

@duglin
Copy link
Contributor

duglin commented May 22, 2023

@dgeorgievski can you rebase your PR?

Signed-off-by: Dimitar Georgievski <[email protected]>
@dgeorgievski
Copy link
Contributor Author

Rebased

@duglin
Copy link
Contributor

duglin commented Jun 1, 2023

thanks!
LGTM
ping @lionelvillard @embano1

Copy link
Member

@embano1 embano1 left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Minor comments

Comment on lines +11 to +12
go get github.com/gin-gonic/gin
go get github.com/rs/zerolog/log
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Suggested change
go get github.com/gin-gonic/gin
go get github.com/rs/zerolog/log
go get .

go run main.go
```

Test a CloudEvent
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Suggested change
Test a CloudEvent
Send a CloudEvent

```shell
curl -v \
-H "Ce-Id: e7d95c20-6eb4-4614-946d-27b0ce41c7ff" \
-H "Ce-Source: /apis///namespaces/dimitar//clone-build-n4qhgl" \
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Suggested change
-H "Ce-Source: /apis///namespaces/dimitar//clone-build-n4qhgl" \
-H "Ce-Source: /apis/namespaces/dimitar/clone-build-n4qhgl" \

Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

or is the above a real value from the example event?

}

func cloudEventsHandler() gin.HandlerFunc {

Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

nit: remove

}

func main() {

Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

nit: remove

@lionelvillard lionelvillard merged commit 9970acc into cloudevents:main Jun 1, 2023
lionelvillard added a commit that referenced this pull request Jun 1, 2023
@lionelvillard
Copy link
Contributor

Oops sorry @embano1, I went a bit fast on this one.

@dgeorgievski Can you address @dgeorgievski comments in a different PR ?

dgeorgievski added a commit to dgeorgievski/sdk-go that referenced this pull request Jun 2, 2023
Fixes for prematurely closed cloudevents#842 PR. Applied all suggested code and doc
changes..
dgeorgievski added a commit to dgeorgievski/sdk-go that referenced this pull request Jun 2, 2023
Fixes for prematurely closed cloudevents#842 PR. Applied all suggested code and doc
changes..

Signed-off-by: Dimitar Georgievski <[email protected]>
dgeorgievski added a commit to dgeorgievski/sdk-go that referenced this pull request Jun 5, 2023
Fixes for prematurely closed cloudevents#842 PR. Applied all suggested code and doc
changes..

Signed-off-by: Dimitar Georgievski <[email protected]>
lionelvillard pushed a commit that referenced this pull request Jun 8, 2023
Fixes for prematurely closed #842 PR. Applied all suggested code and doc
changes..

Signed-off-by: Dimitar Georgievski <[email protected]>
@dgeorgievski dgeorgievski deleted the http-samples-receiver-gin branch June 9, 2023 13:38
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

4 participants