Skip to content

Commit

Permalink
fix: typo
Browse files Browse the repository at this point in the history
  • Loading branch information
dyaksa committed Aug 26, 2024
1 parent 963fc94 commit 36deff8
Show file tree
Hide file tree
Showing 6 changed files with 12 additions and 3 deletions.
Empty file added Makefile
Empty file.
10 changes: 8 additions & 2 deletions examples/test_client.go
Original file line number Diff line number Diff line change
Expand Up @@ -14,12 +14,18 @@ import (

func main() {
client := httpclient.NewClient(&httpclient.Config{
Name: "test",
BaseUrl: "http://localhost:3001",
Name: "test",
BaseUrl: "http://localhost:3001",
ConsiderServerErrorAsFailure: true,
ServerErrorThreshold: 500,
ReadyToTrip: func(cunts httpclient.Counts) bool {
return cunts.TotalFailures > 2
},
Timeout: 30 * time.Second,
})

logger := plugins.NewLogger(nil, nil)

client.AddPlugin(logger)

http.HandleFunc("/test", func(w http.ResponseWriter, r *http.Request) {
Expand Down
1 change: 1 addition & 0 deletions httpclient/breaker_test.go
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
package httpclient
2 changes: 1 addition & 1 deletion httpclient/client.go
Original file line number Diff line number Diff line change
Expand Up @@ -20,7 +20,7 @@ type Config struct {
MaxRequests uint32
Interval time.Duration
Timeout time.Duration
ReadyToTrip func(cunts Counts) bool
ReadyToTrip func(counts Counts) bool
OnStateChange func(name string, to State, from State)

ConsiderServerErrorAsFailure bool
Expand Down
1 change: 1 addition & 0 deletions httpclient/client_test.go
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
package httpclient
1 change: 1 addition & 0 deletions httpclient/options_test.go
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
package httpclient

0 comments on commit 36deff8

Please sign in to comment.