aboutsummaryrefslogtreecommitdiff
path: root/lbclient.go
diff options
context:
space:
mode:
authorGravatar Oleksandr Redko <Oleksandr_Redko@epam.com> 2023-12-13 07:56:24 +0200
committerGravatar GitHub <noreply@github.com> 2023-12-13 13:56:24 +0800
commit9d6b4702602cd29387a639c35cfb92e21a3bad11 (patch)
treed399130b9276f88be21cd277940110154df329f9 /lbclient.go
parentchore: Set max line length to 130 characters (#1676) (diff)
downloadfasthttp-9d6b4702602cd29387a639c35cfb92e21a3bad11.tar.gz
fasthttp-9d6b4702602cd29387a639c35cfb92e21a3bad11.tar.bz2
fasthttp-9d6b4702602cd29387a639c35cfb92e21a3bad11.zip
chore: Add missing dots at the end of comments (#1677)
Diffstat (limited to 'lbclient.go')
-rw-r--r--lbclient.go14
1 files changed, 7 insertions, 7 deletions
diff --git a/lbclient.go b/lbclient.go
index 7fd8a93..a9a40a2 100644
--- a/lbclient.go
+++ b/lbclient.go
@@ -59,12 +59,12 @@ type LBClient struct {
// The timeout may be overridden via LBClient.Timeout.
const DefaultLBClientTimeout = time.Second
-// DoDeadline calls DoDeadline on the least loaded client
+// DoDeadline calls DoDeadline on the least loaded client.
func (cc *LBClient) DoDeadline(req *Request, resp *Response, deadline time.Time) error {
return cc.get().DoDeadline(req, resp, deadline)
}
-// DoTimeout calculates deadline and calls DoDeadline on the least loaded client
+// DoTimeout calculates deadline and calls DoDeadline on the least loaded client.
func (cc *LBClient) DoTimeout(req *Request, resp *Response, timeout time.Duration) error {
deadline := time.Now().Add(timeout)
return cc.get().DoDeadline(req, resp, deadline)
@@ -95,8 +95,8 @@ func (cc *LBClient) init() {
}
}
-// AddClient adds a new client to the balanced clients
-// returns the new total number of clients
+// AddClient adds a new client to the balanced clients and
+// returns the new total number of clients.
func (cc *LBClient) AddClient(c BalancingClient) int {
cc.mu.Lock()
cc.cs = append(cc.cs, &lbClient{
@@ -107,9 +107,9 @@ func (cc *LBClient) AddClient(c BalancingClient) int {
return len(cc.cs)
}
-// RemoveClients removes clients using the provided callback
-// if rc returns true, the passed client will be removed
-// returns the new total number of clients
+// RemoveClients removes clients using the provided callback.
+// If rc returns true, the passed client will be removed.
+// Returns the new total number of clients.
func (cc *LBClient) RemoveClients(rc func(BalancingClient) bool) int {
cc.mu.Lock()
n := 0