Thanks to visit codestin.com
Credit goes to github.com

Skip to content

add -protoset-out option#120

Merged
jhump merged 3 commits intomasterfrom
jh/protoset-out
Sep 30, 2019
Merged

add -protoset-out option#120
jhump merged 3 commits intomasterfrom
jh/protoset-out

Conversation

@jhump
Copy link
Contributor

@jhump jhump commented Sep 30, 2019

Resolves #118

This allows use of grpcurl to save protoset files of the descriptors that it resolves using service reflection. When doing grpcurl <endpoint> list, this will save a protoset file that has the definitions for all of the services that the given endpoint exposes (assuming it supports server reflection).

protosetOut = flags.String("protoset-out", "", prettify(`
The name of a file to be written that will contain a FileDescriptorSet
proto. With the list and describe verbs, the listed or described
elements, and their transitive dependencies, will be written to the
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I think you can remove both these commas?

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

done

desc_source.go Outdated
return nil
}

func addFilesToSet(seen map[string]struct{}, fds *[]*descpb.FileDescriptorProto, fd *desc.FileDescriptor) {
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

could follow more normal append pattern, e.g. `allFilesSlice = addFilesToSet(allFilesSlice, expandedFiles, fds[filename])

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

done

@jhump jhump merged commit ccc9007 into master Sep 30, 2019
@jhump jhump deleted the jh/protoset-out branch September 30, 2019 13:50
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

Successfully merging this pull request may close these issues.

Store protoset from reflection endpoint

3 participants