-
Notifications
You must be signed in to change notification settings - Fork 219
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
http: Added a Gin http receiver sample #842
Conversation
@dgeorgievski can you rebase your PR? |
Signed-off-by: Dimitar Georgievski <[email protected]>
65299fc
to
215ea79
Compare
Rebased |
thanks! |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Minor comments
go get github.com/gin-gonic/gin | ||
go get github.com/rs/zerolog/log |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
go get github.com/gin-gonic/gin | |
go get github.com/rs/zerolog/log | |
go get . |
go run main.go | ||
``` | ||
|
||
Test a CloudEvent |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
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" \ |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
-H "Ce-Source: /apis///namespaces/dimitar//clone-build-n4qhgl" \ | |
-H "Ce-Source: /apis/namespaces/dimitar/clone-build-n4qhgl" \ |
There was a problem hiding this comment.
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 { | ||
|
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
nit: remove
} | ||
|
||
func main() { | ||
|
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
nit: remove
This reverts commit 9970acc.
Oops sorry @embano1, I went a bit fast on this one. @dgeorgievski Can you address @dgeorgievski comments in a different PR ? |
Fixes for prematurely closed cloudevents#842 PR. Applied all suggested code and doc changes..
Fixes for prematurely closed cloudevents#842 PR. Applied all suggested code and doc changes.. Signed-off-by: Dimitar Georgievski <[email protected]>
Fixes for prematurely closed cloudevents#842 PR. Applied all suggested code and doc changes.. Signed-off-by: Dimitar Georgievski <[email protected]>
Fixes for prematurely closed #842 PR. Applied all suggested code and doc changes.. Signed-off-by: Dimitar Georgievski <[email protected]>
A simple example of a Gin http receiver for CloudEvents. The Gorilla/mux project is archived which makes the existing gorilla receiver example deprecated.