MCPcopy Create free account
hub / github.com/pace/bricks / addExternalDependencyToTrailer

Function addExternalDependencyToTrailer

grpc/server.go:159–168  ·  view source on GitHub ↗

addExternalDependencyToTrailer adds the external dependencies to the grpc trailer. This is used to track external dependencies which are updated during the request lifecycle.

(ctx context.Context)

Source from the content-addressed store, hash-verified

157// addExternalDependencyToTrailer adds the external dependencies to the grpc trailer.
158// This is used to track external dependencies which are updated during the request lifecycle.
159func addExternalDependencyToTrailer(ctx context.Context) error {
160 edc := middleware.ExternalDependencyContextFromContext(ctx)
161 if edc == nil {
162 return nil
163 }
164
165 md := metadata.Pairs(MetadataKeyExternalDependencies, edc.String())
166
167 return grpc.SetTrailer(ctx, md)
168}
169
170func prepareContext(ctx context.Context) (context.Context, metadata.MD) {
171 md, _ := metadata.FromIncomingContext(ctx)

Callers 1

ServerFunction · 0.85

Calls 2

StringMethod · 0.45

Tested by

no test coverage detected

Used in the wild real call sites across dependent graphs

searching dependent graphs…