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

Function NewServerCredentials

credentials/xds/xds.go:68–76  ·  view source on GitHub ↗

NewServerCredentials returns a new server-side transport credentials implementation which uses xDS APIs to fetch its security configuration.

(opts ServerOptions)

Source from the content-addressed store, hash-verified

66// NewServerCredentials returns a new server-side transport credentials
67// implementation which uses xDS APIs to fetch its security configuration.
68func NewServerCredentials(opts ServerOptions) (credentials.TransportCredentials, error) {
69 if opts.FallbackCreds == nil {
70 return nil, errors.New("missing fallback credentials")
71 }
72 return &credsImpl{
73 isClient: false,
74 fallback: opts.FallbackCreds,
75 }, nil
76}
77
78// credsImpl is an implementation of the credentials.TransportCredentials
79// interface which uses xDS APIs to fetch its security configuration.

Calls

no outgoing calls