-
Notifications
You must be signed in to change notification settings - Fork 19
feat(plugins): add kratos-http community plugin for v2.9.2 #2164
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
base: main
Are you sure you want to change the base?
Changes from all commits
File filter
Filter by extension
Conversations
Jump to
Diff view
Diff view
There are no files selected for viewing
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,4 @@ | ||
| source: | ||
| github: | ||
| owner: go-kratos | ||
| repository: kratos | ||
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,2 @@ | ||
| * | ||
| !Dockerfile |
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,15 @@ | ||
| # syntax=docker/dockerfile:1.17 | ||
| FROM --platform=$BUILDPLATFORM golang:1.25.0-bookworm AS build | ||
|
|
||
| ARG TARGETOS TARGETARCH | ||
| ENV CGO_ENABLED=0 GOOS=$TARGETOS GOARCH=$TARGETARCH | ||
|
|
||
| RUN --mount=type=cache,target=/go/pkg/mod \ | ||
| go install -ldflags="-s -w" -trimpath go install github.com/go-kratos/kratos/cmd/protoc-gen-go-http/v2@b9fab9a \ | ||
|
Member
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. This should use a tagged version - it will require the upstream project to create a tag named See the grpc-go plugin for an example: https://github.com/grpc/grpc-go/releases/tag/cmd%2Fprotoc-gen-go-grpc%2Fv1.6.0 |
||
| && mv /go/bin/${GOOS}_${GOARCH}/protoc-gen-go-http /go/bin/protoc-gen-go-http || true | ||
|
|
||
| FROM scratch | ||
| COPY --from=build --link --chown=root:root /etc/passwd /etc/passwd | ||
| COPY --from=build --link --chown=root:root /go/bin/protoc-gen-go-http . | ||
| USER nobody | ||
| ENTRYPOINT [ "/protoc-gen-go-http" ] | ||
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,8 @@ | ||
| version: v1 | ||
|
Member
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. This looks to be missing a few fields (like Does it have dependencies on other generated code (like from |
||
| name: buf.build/community/kratos-http | ||
|
Member
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. These files for the plugin need to be moved to a corresponding directory under plugins - |
||
| plugin_version: v0.7.1 | ||
| source_url: https://github.com/go-kratos/kratos/tree/main/cmd/protoc-gen-go-http | ||
|
Member
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. We typically just use the top-level GitHub project URL in these files. |
||
| integration_guide_url: https://github.com/go-kratos/kratos#getting-started | ||
| description: A protoc plugin that generates Kratos HTTP server/client stubs and routing code from protobuf services annotated with HTTP options. | ||
| spdx_license_id: MIT | ||
| license_url: https://github.com/go-kratos/kratos/blob/main/LICENSE | ||
|
Member
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. These use the versioned URL in case things are moved around in the repository, however I don't see a corresponding tag in the source repo for the protoc-gen-go-http command (https://pkg.go.dev/github.com/go-kratos/kratos/cmd/protoc-gen-go-http/v2 is showing a v2 pseudo version). |
||
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Once a tagged release is available, this should update to use a goproxy source similar to https://github.com/bufbuild/plugins/blob/main/plugins/grpc/go/source.yaml.