Liking cljdoc? Tell your friends :D

p

This repo contains the protocol buffer v3 definitions and generated modules for data types that cross service boundaries in the Discovery Environment.

Requirements

TL;DR

You will need the following:

  • protoc
  • protoc-gen-go
  • protoc-gen-doc
  • protoc-gen-prost
  • A symlink to the protobuf include/ directory in /usr/local/include

Installation

On MacOS, you can install protoc and protoc-gen-go with homebrew.

brew install protobuf protoc-gen-go

Link the google/ directory from protobuf into /usr/local/include, replacing the 3.19.4 in the directory path with whichever version got installed above:

sudo ln -sf $HOMEBREW_CELLAR/protobuf/3.19.4/include/google /usr/local/include/google

You can install protoc-gen-doc with the go install command:

go install github.com/pseudomuto/protoc-gen-doc/cmd/protoc-gen-doc@latest

Install Rust and Cargo on MacOS with zsh

Instructions originally found at https://stackoverflow.com/a/68617314.

Run the following in a terminal.

curl --proto '=https' --tlsv1.2 -sSf https://sh.rustup.rs | sh

When prompted, customize the installation. When asked about modifying the PATH, select No. All of the other questions can be set to their default setting.

Next, open your .zshrc file (typically located at ~/.zshrc) and add:

export PATH PATH="$HOME/.cargo/bin:$PATH"

Finally, source your .zshrc file:\

. ~/.zshrc

Run rustc --version to make sure the rust compiler is installed.

Run cargo --version to make sure that cargo is installed.

Install protoc-gen-prost

Install protoc-gen-prost with Cargo:

cargo install protoc-gen-prost

That will install the protoc-gen-prost binary in ~/.cargo/bin. You'll want to put that directory in your $PATH if it isn't already there.

Next, install protoc-gen-prost-serde with Cargo:

cargo install protoc-gen-prost-serde

Repo Layout

protos/ contains the protocol buffers definitions.

go/ contains the generated Go modules. Do not edit these files directly.

java/ contains the generated Java packages. Do not edit these files directly.

debuff/ contains the Rust cargo project containing the generated rust module. The file containing the generated code is debuff/src/gen.rs. Do not edit that file directly. The other files in debuff may contain utility code to make the generated code

Building Go packages

The Makefile has a target to build the Go modules, so make or make go will both work.

make clean will delete the generated files, so it is not run by default.

NATS Subject Mapping

SubjectAcceptsResponseResponding Service
cyverse.qms.user.usages.addqms.AddUsagesqms.UsageResponsesubscriptions
cyverse.qms.user.usages.getqms.GetUsagesqms.UsageListsubscriptions
cyverse.qms.user.overages.getqms.AllOveragesRequestqms.OverageListsubscriptions
cyverse.qms.user.overages.checkqms.IsOverageRequestqms.IsOveragesubscriptions
cyverse.discoenv.analyses.>analysis.AnalysisRecordLookupRequestanalysis.AnalysisRecordListdiscoenv-analyses
cyverse.discoenv.users.>users.UserLookupRequestuser.Userdiscoenv-users
cyverse.qms.user.updates.getqms.UpdateListRequestqms.UpdateListResponsesubscriptions
cyverse.qms.user.updates.addqms.AddUpdateRequestqms.AddUpdateResponsesubscriptions
cyverse.qms.user.summary.getqms.RequestByUsernameqms.UserPlanResponsesubscriptions

`

Hints/Tips/Notes

Reload VScode Window after generating Go code.

Sometimes the VSCode Go support thinks that some of the modules needed by the go package are missing. I've found that reloading the window from the command palette fixes that problem.

Can you improve this documentation? These fine people already did:
John Wregglesworth & Sarah Roberts
Edit on GitHub

cljdoc is a website building & hosting documentation for Clojure/Script libraries

× close