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

Function WithAuthority

dialoptions.go:627–631  ·  view source on GitHub ↗

WithAuthority returns a DialOption that specifies the value to be used as the :authority pseudo-header and as the server name in authentication handshake. This overrides all other ways of setting authority on the channel, but can be overridden per-call by using grpc.CallAuthority.

(a string)

Source from the content-addressed store, hash-verified

625// This overrides all other ways of setting authority on the channel, but can be
626// overridden per-call by using grpc.CallAuthority.
627func WithAuthority(a string) DialOption {
628 return newFuncDialOption(func(o *dialOptions) {
629 o.authority = a
630 })
631}
632
633// WithChannelzParentID returns a DialOption that specifies the channelz ID of
634// current ClientConn's parent. This function is used in nested channel creation

Callers 14

dialOptsMethod · 0.92
TestCredsBundleBothMethod · 0.92
TestFailingProviderMethod · 0.92
TestCaReloadingMethod · 0.92
Test_SPIFFE_ReloadingMethod · 0.92
TestMTLSMethod · 0.92
Test_MTLS_SPIFFEMethod · 0.92

Calls 1

newFuncDialOptionFunction · 0.85

Tested by 13

TestCredsBundleBothMethod · 0.74
TestFailingProviderMethod · 0.74
TestCaReloadingMethod · 0.74
Test_SPIFFE_ReloadingMethod · 0.74
TestMTLSMethod · 0.74
Test_MTLS_SPIFFEMethod · 0.74