Skip to content

Commit

Permalink
feat: rename to grpc-service-config
Browse files Browse the repository at this point in the history
Shorter and more descriptive project name.
  • Loading branch information
odsod committed Jul 26, 2022
1 parent d036202 commit 3b41cd7
Show file tree
Hide file tree
Showing 6 changed files with 29 additions and 7 deletions.
2 changes: 1 addition & 1 deletion .goreleaser.yml
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,7 @@ before:
builds:
- id: protoc-gen-go-grpc-service-config
binary: protoc-gen-go-grpc-service-config
main: ./main.go
main: ./protoc-gen-go-grpc-service-config/main.go
env:
- CGO_ENABLED=0
goos:
Expand Down
2 changes: 1 addition & 1 deletion .sage/main.go
Original file line number Diff line number Diff line change
Expand Up @@ -105,6 +105,6 @@ func ProtocGenGoGrpcServiceConfig(ctx context.Context) error {
"build",
"-o",
sg.FromBinDir("protoc-gen-go-grpc-service-config"),
sg.FromGitRoot(),
"./cmd/protoc-gen-go-grpc-service-config",
).Run()
}
4 changes: 2 additions & 2 deletions buf.gen.example.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -3,11 +3,11 @@ version: v1
managed:
enabled: true
go_package_prefix:
default: go.einride.tech/protoc-gen-go-grpc-service-config
default: go.einride.tech/grpc-service-config
except:
- buf.build/googleapis/googleapis

plugins:
- name: go-grpc-service-config
out: internal/gen/proto
opt: module=go.einride.tech/protoc-gen-go-grpc-service-config
opt: module=go.einride.tech/grpc-service-config
5 changes: 4 additions & 1 deletion main.go → ...protoc-gen-go-grpc-service-config/main.go
Original file line number Diff line number Diff line change
Expand Up @@ -92,7 +92,10 @@ func (p *plugin) generateFromProto() error {
g.P()
g.P("// DefaultServiceConfig is the default service config for all services in the package.")
g.P("// Source: ", file.Desc.Path(), ".")
g.P("const DefaultServiceConfig = `", protojson.MarshalOptions{}.Format(defaultServiceConfig), "`")
g.P("const DefaultServiceConfig = `", protojson.MarshalOptions{
Multiline: true,
Indent: " ",
}.Format(defaultServiceConfig), "`")
}
return nil
}
Expand Down
2 changes: 1 addition & 1 deletion go.mod
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
module go.einride.tech/protoc-gen-go-grpc-service-config
module go.einride.tech/grpc-service-config

go 1.18

Expand Down

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

0 comments on commit 3b41cd7

Please sign in to comment.