From 7d5dd691af7587fc1852e2d78ef63d3cb60f3505 Mon Sep 17 00:00:00 2001 From: Boris Glimcher <36732377+glimchb@users.noreply.github.com> Date: Tue, 24 Oct 2023 19:53:29 -0400 Subject: [PATCH] fix: add readme to inventory Signed-off-by: Boris Glimcher <36732377+glimchb@users.noreply.github.com> --- inventory/README.md | 59 +++++++++++++++++++++++++++++++++++++++++++++ 1 file changed, 59 insertions(+) create mode 100644 inventory/README.md diff --git a/inventory/README.md b/inventory/README.md new file mode 100644 index 00000000..7b4dc49e --- /dev/null +++ b/inventory/README.md @@ -0,0 +1,59 @@ +# OPI Inventory APIs + +## Demos + +None + +## Clients + +see and + +## Reference implementations + +- + +_All implementations above are reference only and __not__ meant to be used as-is in production_ + +## More documentation + +see + +## Implementation + +Compile it as: + +```bash +docker run --user=$$(id -u):$$(id -g) --rm -v "${PWD}":/defs -v "${PWD}/../common/v1":/common namely/protoc-all:1.51_2 -i /common --lint -d v1 -l go -o ./v1/gen/go/ --go-source-relative +``` + +Linter it as: + +```bash +docker run --user=$$(id -u):$$(id -g) --rm --entrypoint=sh -v "${PWD}/../common/v1":/common -v "${PWD}"/v1/:/out -w /out ghcr.io/docker-multiarch/google-api-linter:1.57.0 -c "api-linter -I /common /out/*.proto --output-format github --set-exit-status" +``` + +Additional linter: + +```bash +docker run --rm -it -v /etc/pki/ca-trust/extracted/pem/tls-ca-bundle.pem:/etc/ssl/certs/ca-certificates.crt -v "$(pwd):/workspace" -w /workspace bufbuild/buf lint +``` + +Generate [docs](v1/autogen.md) as: + +```bash +docker run --user=$$(id -u):$$(id -g) --rm --entrypoint=sh -v "${PWD}/../common/v1":/common -v "${PWD}"/v1alpha1/:/out -w /out -v "${PWD}"/v1:/protos pseudomuto/protoc-gen-doc:1.5.1 -c "protoc -I /common -I /protos --doc_out=/out --doc_opt=markdown,autogen.md /protos/*.proto /common/*.proto" +``` + +Test your APIs even if unmerged using your private fork like this: + +```bash +chmod a+w go.* +docker run --rm -it -v `pwd`:/app -w /app golang:alpine go mod edit -replace github.com/opiproject/opi-api@main=github.com/YOURUSERNAME/opi-api@main +docker run --rm -it -e GO111MODULE=on -v `pwd`:/app -w /app golang:alpine go get -u github.com/YOURUSERNAME/opi-api/inventory/v1/gen/go@a98ca449468a +``` + +## Documentation for reference of other specs + +- +- +-