Skip to content

Commit

Permalink
initial pass at go-protobuf library
Browse files Browse the repository at this point in the history
  • Loading branch information
jbcpollak committed Apr 29, 2024
1 parent 2417be2 commit f45b7c6
Show file tree
Hide file tree
Showing 43 changed files with 128 additions and 20 deletions.
2 changes: 2 additions & 0 deletions go/.gitignore
Original file line number Diff line number Diff line change
@@ -0,0 +1,2 @@

github.com
18 changes: 18 additions & 0 deletions go/generate.sh
Original file line number Diff line number Diff line change
@@ -0,0 +1,18 @@
#!/bin/bash

# MacOS:
# brew install protobuf@3
# export PATH="/opt/homebrew/opt/protobuf@3/bin:$PATH"
# export LDFLAGS="-L/opt/homebrew/opt/protobuf@3/lib"
# export CPPFLAGS="-I/opt/homebrew/opt/protobuf@3/include"

# All Platforms:
# go install google.golang.org/protobuf/cmd/protoc-gen-go@latest
# go install github.com/goreleaser/goreleaser@latest
# export PATH="$PATH:$(go env GOPATH)/bin"

PROJDIR=$(realpath "$(dirname "${BASH_SOURCE[0]}")") # Get the project directory

cd "$PROJDIR" || exit 1

protoc --go_out=./ --proto_path=schemas/proto schemas/proto/**/*.proto --descriptor_set_out=/dev/null
5 changes: 5 additions & 0 deletions go/go.mod
Original file line number Diff line number Diff line change
@@ -0,0 +1,5 @@
module foxglove/schemas

go 1.22

require google.golang.org/protobuf v1.33.0
6 changes: 6 additions & 0 deletions go/go.sum
Original file line number Diff line number Diff line change
@@ -0,0 +1,6 @@
github.com/google/go-cmp v0.5.5 h1:Khx7svrCpmxxtHBq5j2mp/xVjsi8hQMfNLvJFAlrGgU=
github.com/google/go-cmp v0.5.5/go.mod h1:v8dTdLbMG2kIc/vJvl+f65V22dbkXbowE6jgT/gNBxE=
golang.org/x/xerrors v0.0.0-20191204190536-9bdfabe68543 h1:E7g+9GITq07hpfrRu66IVDexMakfv52eLZ2CXBWiKr4=
golang.org/x/xerrors v0.0.0-20191204190536-9bdfabe68543/go.mod h1:I/5z698sn9Ka8TeJc9MKroUUfqBBauWjQqLJ2OPfmY0=
google.golang.org/protobuf v1.33.0 h1:uNO2rsAINq/JlFpSdYEKIZ0uKD/R9cpdv0T+yoGwGmI=
google.golang.org/protobuf v1.33.0/go.mod h1:c6P6GXX6sHbq/GpV6MGZEdwhWPcYBgnhAHhKbcUYpos=
1 change: 1 addition & 0 deletions internal/generateProto.ts
Original file line number Diff line number Diff line change
Expand Up @@ -111,6 +111,7 @@ export function generateProto(
const outputSections = [
`// Generated by https://github.com/foxglove/schemas`,
'syntax = "proto3";',
'option go_package = "github.com/foxglove/schemas',

Array.from(imports)
.sort()
Expand Down
2 changes: 2 additions & 0 deletions schemas/proto/foxglove/ArrowPrimitive.proto

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

28 changes: 15 additions & 13 deletions schemas/proto/foxglove/CameraCalibration.proto

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

2 changes: 2 additions & 0 deletions schemas/proto/foxglove/CircleAnnotation.proto

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

2 changes: 2 additions & 0 deletions schemas/proto/foxglove/Color.proto

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

4 changes: 3 additions & 1 deletion schemas/proto/foxglove/CompressedImage.proto

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

8 changes: 5 additions & 3 deletions schemas/proto/foxglove/CompressedVideo.proto

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

2 changes: 2 additions & 0 deletions schemas/proto/foxglove/CubePrimitive.proto

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

2 changes: 2 additions & 0 deletions schemas/proto/foxglove/CylinderPrimitive.proto

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

2 changes: 2 additions & 0 deletions schemas/proto/foxglove/FrameTransform.proto

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

2 changes: 2 additions & 0 deletions schemas/proto/foxglove/FrameTransforms.proto

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

2 changes: 2 additions & 0 deletions schemas/proto/foxglove/GeoJSON.proto

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

2 changes: 2 additions & 0 deletions schemas/proto/foxglove/Grid.proto

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

2 changes: 2 additions & 0 deletions schemas/proto/foxglove/ImageAnnotations.proto

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

2 changes: 2 additions & 0 deletions schemas/proto/foxglove/KeyValuePair.proto

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

2 changes: 2 additions & 0 deletions schemas/proto/foxglove/LaserScan.proto

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

4 changes: 3 additions & 1 deletion schemas/proto/foxglove/LinePrimitive.proto

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

2 changes: 2 additions & 0 deletions schemas/proto/foxglove/LocationFix.proto

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

2 changes: 2 additions & 0 deletions schemas/proto/foxglove/Log.proto

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

2 changes: 2 additions & 0 deletions schemas/proto/foxglove/ModelPrimitive.proto

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

2 changes: 2 additions & 0 deletions schemas/proto/foxglove/PackedElementField.proto

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

2 changes: 2 additions & 0 deletions schemas/proto/foxglove/Point2.proto

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

2 changes: 2 additions & 0 deletions schemas/proto/foxglove/Point3.proto

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

2 changes: 2 additions & 0 deletions schemas/proto/foxglove/PointCloud.proto

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

2 changes: 2 additions & 0 deletions schemas/proto/foxglove/PointsAnnotation.proto

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

2 changes: 2 additions & 0 deletions schemas/proto/foxglove/Pose.proto

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

2 changes: 2 additions & 0 deletions schemas/proto/foxglove/PoseInFrame.proto

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

2 changes: 2 additions & 0 deletions schemas/proto/foxglove/PosesInFrame.proto

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

Loading

0 comments on commit f45b7c6

Please sign in to comment.