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

Offer an "official" Golang client #13

Closed
julsemaan opened this issue Jan 3, 2018 · 2 comments · Fixed by #14
Closed

Offer an "official" Golang client #13

julsemaan opened this issue Jan 3, 2018 · 2 comments · Fixed by #14

Comments

@julsemaan
Copy link
Contributor

Since this is written using Golang and I'd expect many users to use Golang for their clients if they're writing backend code, it would be nice to have a client library to consume what this server produces.

Makes it much faster/simpler to integrate and allows to maintain best practices in the client that are aligned with the ones of the server.

It could also be used as an example to write clients in other languages.

I've written a client for one of my other projects, not sure if you're interested in bringing this into your codebase, I can open a PR if that's interesting for you. At the same time I'd polish up the godoc + write a proper readme

Code is here:
https://github.com/julsemaan/golongpoll-client

BTW, really like this library, just so simple and effective, really great work.

As a candy, that would fix #12 at the same time and lets be honest, who doesn't like candies!

@jcuga
Copy link
Owner

jcuga commented Jan 4, 2018

Thanks--adding the client would be great! Feel free to make a pull request.

By the way, can your client support stuff like HTTP basic auth, HTTPS, and/or client certs? Just thinking about adding flexibility for anyone wanting to add extra security. I'm guessing that this is possible by specifying/passing-in the http.Client that gets used (but it's been a while so I'm just guessing without digging into the godocs...) What you have looks good, if you want improve the readme/examples and add a hook to support a variety of HTTP(s) connection support that would be awesome.

@julsemaan
Copy link
Contributor Author

@jcuga

HTTPS can be fine tuned by changing the HttpClient in the Client struct and using HTTPS is possible by using it in the URL. That allows the client user to configure the HTTP connection behavior as he wishes. That I guess should cover most of your points.

Basic auth though cannot be controlled via the http.Client, so I'll add that as a configurable parameter in the Client itself as it has to be set on the http.Request and not the httpd.Client

I'll add basic auth + some polishing and get a PR shortly.

Thanks for the input!

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 a pull request may close this issue.

2 participants