Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Why does gateway use ServerMetadata? #388

Closed
tamalsaha opened this issue May 13, 2017 · 1 comment
Closed

Why does gateway use ServerMetadata? #388

tamalsaha opened this issue May 13, 2017 · 1 comment

Comments

@tamalsaha
Copy link
Collaborator

gateway generated code uses something called ServerMetadata . The trailers from this metadata are returned from gateway response (not the original trailer from grpc response). This seems like a way for grpc server implementation to return some extra metadata. This seems unnecessary.

Below is an example of generated code that shows how ServerMetadata is used.

func request_Artifacts_Search_0(ctx context.Context, marshaler runtime.Marshaler, client ArtifactsClient, req *http.Request, pathParams map[string]string) (proto.Message, runtime.ServerMetadata, error) {
	var protoReq ArtifactSearchRequest
	var metadata runtime.ServerMetadata

	if err := runtime.PopulateQueryParameters(&protoReq, req.URL.Query(), filter_Artifacts_Search_0); err != nil {
		return nil, metadata, status.Errorf(codes.InvalidArgument, "%v", err)
	}

	msg, err := client.Search(ctx, &protoReq, grpc.Header(&metadata.HeaderMD), grpc.Trailer(&metadata.TrailerMD))
	return msg, metadata, err

}
@tamalsaha tamalsaha changed the title Why does gateway uses ServerMetadata? Why does gateway use ServerMetadata? May 13, 2017
@tamalsaha
Copy link
Collaborator Author

Actually I see how this is used.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant