MCPcopy
hub / github.com/grpc/grpc-go / Pick

Method Pick

interop/xds/custom_lb.go:126–133  ·  view source on GitHub ↗

Pick appends the rpc-behavior metadata entry to the pick result of the child.

(info balancer.PickInfo)

Source from the content-addressed store, hash-verified

124
125// Pick appends the rpc-behavior metadata entry to the pick result of the child.
126func (p *rpcBehaviorPicker) Pick(info balancer.PickInfo) (balancer.PickResult, error) {
127 pr, err := p.childPicker.Pick(info)
128 if err != nil {
129 return balancer.PickResult{}, err
130 }
131 pr.Metadata = metadata.Join(pr.Metadata, metadata.Pairs("rpc-behavior", p.rpcBehavior))
132 return pr, nil
133}
134
135func newRPCBehaviorPicker(childPicker balancer.Picker, rpcBehavior string) *rpcBehaviorPicker {
136 return &rpcBehaviorPicker{

Callers

nothing calls this directly

Calls 3

JoinFunction · 0.92
PairsFunction · 0.92
PickMethod · 0.65

Tested by

no test coverage detected