Hi all,

i'm trying to use the context metadata aside from the pure RPC 
communication between my client and server.

In this code example 
(https://gitlab.com/pantomath-io/demo-grpc/blob/add-auth), I have a client 
adding a login/password in the metadata sent to the server. This latest 
uses an UnaryInterceptor to extract the metadata from the context, and to 
process the RPC call (or block it).

Now, I'd like the server to inject metadata in the *response* to the 
client, and the client to read it (for instance, the server could inject a 
serial number in the response).

I'm quite confused on how to do that:
- do the client and server share the same context? (ie the server should 
set the metadata in the context it knows, and the client would read it from 
there?)
- are SetHeader() [1] and SetTrailer() [2] functions made just for that? If 
so, is it only in the case of stream (as opposed to RPC calls)?
- is there any mechanism to make this exchange systematic (like the 
Interceptor)?

Many thanks,
julien


[1] https://godoc.org/google.golang.org/grpc#SetHeader
[2] https://godoc.org/google.golang.org/grpc#SetTrailer

-- 
You received this message because you are subscribed to the Google Groups 
"grpc.io" group.
To unsubscribe from this group and stop receiving emails from it, send an email 
to [email protected].
To post to this group, send email to [email protected].
Visit this group at https://groups.google.com/group/grpc-io.
To view this discussion on the web visit 
https://groups.google.com/d/msgid/grpc-io/0ecbdd5a-bc4b-4321-a8d0-94e4d6e52a7a%40googlegroups.com.
For more options, visit https://groups.google.com/d/optout.

Reply via email to