const ( // XGoogFieldMaskHeader is the canonical header key for the [System Parameter] // that specifies the response read mask. The value(s) for this header // must adhere to format described in [fieldmaskpb]. // // [System Parameter]: https://cloud.google.com/apis/docs/system-parameters // [fieldmaskpb]: https://google.golang.org/protobuf/types/known/fieldmaskpb XGoogFieldMaskHeader = "x-goog-fieldmask" )
func HeadersFromContext(ctx context.Context) map[string][]string
HeadersFromContext retrieves headers set from SetHeaders. These headers can then be cast to http.Header or metadata.MD to send along on requests.
func SetHeaders(ctx context.Context, keyvals ...string) context.Context
SetHeaders stores key value pairs in the returned context that can later be retrieved by HeadersFromContext. Values stored in this manner will automatically be retrieved by client libraries and sent as outgoing headers on all requests. keyvals should have a corresponding value for every key provided. If there is an odd number of keyvals this method will panic.
▹ Example