GetRequestMetadata returns the request metadata with per-rpc credentials
(ctx context.Context, uri ...string)
| 24 | |
| 25 | // GetRequestMetadata returns the request metadata with per-rpc credentials |
| 26 | func (m MD) GetRequestMetadata(ctx context.Context, uri ...string) (map[string]string, error) { |
| 27 | md := make(map[string]string) |
| 28 | if m.ID != "" { |
| 29 | md["id"] = m.ID |
| 30 | } |
| 31 | if m.AuthType != "" && m.AuthValue != "" { |
| 32 | md["authorization"] = m.AuthType + " " + m.AuthValue |
| 33 | } |
| 34 | return md, nil |
| 35 | } |
| 36 | |
| 37 | var errUnauthenticated = errors.DefineUnauthenticated("unauthenticated", "the context is not authenticated") |
| 38 |
no outgoing calls