1616 *
1717 */
1818
19- // Package balanceraggregator implements a BalancerAggregator helper.
19+ // Package balanceraggregator implements a balancerAggregator helper.
2020//
2121// # Experimental
2222//
@@ -47,19 +47,19 @@ type ChildState struct {
4747 State balancer.State
4848}
4949
50- // NewBalancer returns a new BalancerAggregator .
50+ // NewBalancer returns a new balancerAggregator .
5151func NewBalancer (cc balancer.ClientConn , opts balancer.BuildOptions ) balancer.Balancer {
52- return & BalancerAggregator {
52+ return & balancerAggregator {
5353 cc : cc ,
5454 bOpts : opts ,
5555 children : resolver .NewEndpointMap (),
5656 }
5757}
5858
59- // BalancerAggregator is a balancer that wraps child balancers. It creates a
59+ // balancerAggregator is a balancer that wraps child balancers. It creates a
6060// child balancer with child config for every unique Endpoint received. It
6161// updates the child states on any update from parent or child.
62- type BalancerAggregator struct {
62+ type balancerAggregator struct {
6363 cc balancer.ClientConn
6464 bOpts balancer.BuildOptions
6565
@@ -78,7 +78,7 @@ type BalancerAggregator struct {
7878// the end of the UpdateClientConnState operation. If any endpoint has no
7979// addresses, returns error. Otherwise returns first error found from a child,
8080// but fully processes the new update.
81- func (ba * BalancerAggregator ) UpdateClientConnState (state balancer.ClientConnState ) error {
81+ func (ba * balancerAggregator ) UpdateClientConnState (state balancer.ClientConnState ) error {
8282 if len (state .ResolverState .Endpoints ) == 0 {
8383 return errors .New ("endpoints list is empty" )
8484 }
@@ -143,10 +143,10 @@ func (ba *BalancerAggregator) UpdateClientConnState(state balancer.ClientConnSta
143143 return ret
144144}
145145
146- // ResolverError forwards the resolver error to all of the BalancerAggregator 's
146+ // ResolverError forwards the resolver error to all of the balancerAggregator 's
147147// children and sends a single synchronous update of the childStates at the end
148148// of the ResolverError operation.
149- func (ba * BalancerAggregator ) ResolverError (err error ) {
149+ func (ba * balancerAggregator ) ResolverError (err error ) {
150150 ba .inhibitChildUpdates .Store (true )
151151 defer func () {
152152 ba .inhibitChildUpdates .Store (false )
@@ -158,11 +158,11 @@ func (ba *BalancerAggregator) ResolverError(err error) {
158158 }
159159}
160160
161- func (ba * BalancerAggregator ) UpdateSubConnState (sc balancer.SubConn , state balancer.SubConnState ) {
161+ func (ba * balancerAggregator ) UpdateSubConnState (sc balancer.SubConn , state balancer.SubConnState ) {
162162 // UpdateSubConnState is deprecated.
163163}
164164
165- func (ba * BalancerAggregator ) Close () {
165+ func (ba * balancerAggregator ) Close () {
166166 for _ , child := range ba .children .Values () {
167167 bal := child .(balancer.Balancer )
168168 bal .Close ()
@@ -172,7 +172,7 @@ func (ba *BalancerAggregator) Close() {
172172// updateState updates this component's state. It sends the aggregated state,
173173// and a picker with round robin behavior with all the child states present if
174174// needed.
175- func (ba * BalancerAggregator ) updateState () {
175+ func (ba * balancerAggregator ) updateState () {
176176 if ba .inhibitChildUpdates .Load () {
177177 return
178178 }
@@ -236,7 +236,7 @@ func (ba *BalancerAggregator) updateState() {
236236}
237237
238238// pickerWithChildStates delegates to the pickers it holds in a round robin
239- // fashion. It also contains the childStates of all the BalancerAggregator 's
239+ // fashion. It also contains the childStates of all the balancerAggregator 's
240240// children.
241241type pickerWithChildStates struct {
242242 pickers []balancer.Picker
@@ -266,7 +266,7 @@ type balancerWrapper struct {
266266 balancer.Balancer // Simply forward balancer.Balancer operations.
267267 balancer.ClientConn // embed to intercept UpdateState, doesn't deal with SubConns
268268
269- ba * BalancerAggregator
269+ ba * balancerAggregator
270270
271271 childState ChildState
272272}
0 commit comments