-
Notifications
You must be signed in to change notification settings - Fork 3
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
Last pre-OSS changes #54
Changes from all commits
File filter
Filter by extension
Conversations
Jump to
Diff view
Diff view
There are no files selected for viewing
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,16 @@ | ||
changelog: | ||
exclude: | ||
labels: | ||
- ignore-for-release | ||
authors: | ||
- dependabot | ||
categories: | ||
- title: Enhancements | ||
labels: | ||
- enhancement | ||
- title: Bugfixes | ||
labels: | ||
- bug | ||
- title: Other changes | ||
labels: | ||
- "*" |
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,4 +1,4 @@ | ||
# Go HTTP Client-Side Load Balancing | ||
# httplb | ||
|
||
[![Build](https://github.com/bufbuild/httplb/actions/workflows/ci.yaml/badge.svg?branch=main)](https://github.com/bufbuild/httplb/actions/workflows/ci.yaml) | ||
[![Report Card](https://goreportcard.com/badge/github.com/bufbuild/httplb)](https://goreportcard.com/report/github.com/bufbuild/httplb) | ||
|
@@ -33,17 +33,13 @@ import ( | |
"time" | ||
|
||
"github.com/bufbuild/httplb" | ||
"github.com/bufbuild/httplb/resolver" | ||
"github.com/bufbuild/httplb/picker" | ||
) | ||
|
||
func main() { | ||
client := httplb.NewClient( | ||
httplb.WithResolver( | ||
// Use a resolver for IPv4. You can pass "ip" for dual-stack setups, | ||
// or "ip6" for pure IPv6. This defaults to "ip" and assumes IPv6 | ||
// is suitable for your deployment. | ||
resolver.NewDNSResolver(net.DefaultResolver, "ip4", 5*time.Minute), | ||
), | ||
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. I changed the example here to be a little shorter and more self-explanatory. WDYT? There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. I kind of liked showing the resolver option, though perhaps the associated comment is unclear why it's useful to show. I suspect the resolver is the most likely thing people would need to tweak, but I could be wrong 🤷. Anyhow, new example is fine, too. |
||
// Switch from the default round-robin policy to power-of-two. | ||
httplb.WithPicker(picker.NewPowerOfTwo), | ||
) | ||
defer client.Close() | ||
resp, err := client.Get("https://example.com") | ||
|
@@ -55,7 +51,8 @@ func main() { | |
} | ||
``` | ||
|
||
And here is how you can use `httplb` with `connect-go`: | ||
If you're using [Connect](https://github.com/connectrpc/connect-go), you can | ||
use `httplb` for your RPC clients: | ||
|
||
```go | ||
func main() { | ||
|
@@ -99,6 +96,5 @@ This project is currently in **alpha**. The API should be considered unstable an | |
|
||
## Legal | ||
|
||
Offered under the [Apache 2 license][badges_license]. | ||
Offered under the [Apache 2 license](LICENSE). | ||
|
||
[badges_license]: https://github.com/bufbuild/knit-go/blob/main/LICENSE |
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.
Does this belong in our oss skeleton? Does this mean we also need to setup standard labels in every oss repo and to also label every PR to get the items correctly categorized into sections?
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.
Sure, I'll put it into the skeleton! I'm not sure how to automate the label creation though. We don't need to label all the PRs - normally, I clean up the release notes and sort things by hand.