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

Gin -> ARPC integration #62

Closed
KevM opened this issue Mar 15, 2024 · 7 comments
Closed

Gin -> ARPC integration #62

KevM opened this issue Mar 15, 2024 · 7 comments
Labels

Comments

@KevM
Copy link

KevM commented Mar 15, 2024

I put together a gist of the bones of my integration or ARPC with Gin. Not sure if something like this is already out there. I wanted to share in case it wasn't. It took a big of figuring out how to properly register the web socket listener with Gin and a http handler and how to get that listener to the arpc Serve invocation.

https://gist.github.com/KevM/4aafd4873df884cc95fc8e606ab0f4e4

@lesismal
Copy link
Owner

Awesome job bro! I would appreciate it very much!
If you like, welcome to make a PR to add the gin-arpc example to arpc/examples, but just make it simple(no need other 3rd libs such as zap logger).

@KevM
Copy link
Author

KevM commented Mar 18, 2024

Ok. How about I port the logger to be log/slog?

@lesismal
Copy link
Owner

Ok. How about I port the logger to be log/slog?

arpc/log.Logger is interface, users can implement arpc/log.Logger interface and set DefaultLogger = UserLogger, and we need to keep compatibility with old versions of go.
So we shouldn't use slog.

Copy link

This issue is stale because it has been open for 30 days with no activity.

@github-actions github-actions bot added the stale label Apr 19, 2024
@KevM
Copy link
Author

KevM commented Apr 19, 2024

Did you want any help adapting my PR? Looks like you closed it. Not sure what gap I have that didn't make it acceptable.

@lesismal
Copy link
Owner

Sorry for late update, I just made the commit to update the websocket server example based on gin, it's simple here:
https://github.com/lesismal/arpc/blob/master/examples/protocols/websocket/server/server.go#L51

@github-actions github-actions bot removed the stale label Apr 20, 2024
Copy link

This issue is stale because it has been open for 30 days with no activity.

@github-actions github-actions bot added the stale label May 20, 2024
@KevM KevM closed this as completed May 21, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

Successfully merging a pull request may close this issue.

2 participants