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

Method run

credentials/tls/certprovider/pemfile/watcher.go:252–270  ·  view source on GitHub ↗

run is a long running goroutine which watches the configured files for changes, and pushes new key material into the appropriate distributors which is returned from calls to KeyMaterial().

(ctx context.Context)

Source from the content-addressed store, hash-verified

250// changes, and pushes new key material into the appropriate distributors which
251// is returned from calls to KeyMaterial().
252func (w *watcher) run(ctx context.Context) {
253 ticker := time.NewTicker(w.opts.RefreshDuration)
254 for {
255 w.updateIdentityDistributor()
256 w.updateRootDistributor()
257 select {
258 case <-ctx.Done():
259 ticker.Stop()
260 if w.identityDistributor != nil {
261 w.identityDistributor.Stop()
262 }
263 if w.rootDistributor != nil {
264 w.rootDistributor.Stop()
265 }
266 return
267 case <-ticker.C:
268 }
269 }
270}
271
272// KeyMaterial returns the key material sourced by the watcher.
273// Callers are expected to use the returned value as read-only.

Callers 1

newProviderFunction · 0.95

Calls 4

updateRootDistributorMethod · 0.95
StopMethod · 0.65
DoneMethod · 0.45

Tested by

no test coverage detected