()
| 244 | } |
| 245 | |
| 246 | func (r *RPCInvocation) GetAttachmentAsContext() context.Context { |
| 247 | ctx := context.Background() |
| 248 | var header = http.Header{} |
| 249 | for k, v := range r.Attachments() { |
| 250 | if str, ok := v.(string); ok { |
| 251 | header.Set(k, str) |
| 252 | continue |
| 253 | } |
| 254 | if str, ok := v.([]string); ok { |
| 255 | for _, s := range str { |
| 256 | header.Add(k, s) |
| 257 | } |
| 258 | continue |
| 259 | } |
| 260 | } |
| 261 | return triple_protocol.NewOutgoingContext(ctx, header) |
| 262 | } |
| 263 | |
| 264 | func (r *RPCInvocation) MergeAttachmentFromContext(ctx context.Context) { |
| 265 | header := triple_protocol.ExtractFromOutgoingContext(ctx) |
nothing calls this directly
no test coverage detected