Skip to content

Commit

Permalink
Move internal/examples to examples folder
Browse files Browse the repository at this point in the history
  • Loading branch information
emcfarlane committed Sep 29, 2023
1 parent a42128f commit 1404a29
Show file tree
Hide file tree
Showing 24 changed files with 31 additions and 34 deletions.
7 changes: 3 additions & 4 deletions Makefile
Original file line number Diff line number Diff line change
Expand Up @@ -29,17 +29,16 @@ clean: ## Delete intermediate build artifacts
.PHONY: test
test: build ## Run unit tests
$(GO) test -vet=off -race -cover ./...
cd internal/examples/pets && $(GO) test -vet=off -race -cover ./...
cd internal/examples/connect+grpc && $(GO) test -vet=off -race -cover ./...
cd examples/pets && $(GO) test -vet=off -race -cover ./...
cd examples/connect+grpc && $(GO) test -vet=off -race -cover ./...

.PHONY: build
build: generate ## Build all packages
$(GO) build ./...

.PHONY: generate
generate: $(BIN)/buf $(BIN)/license-header ## Regenerate code and licenses
$(BIN)/buf generate internal/proto
cd internal/examples/pets && ../../../$(BIN)/buf generate internal/proto
$(BIN)/buf generate
@# We want to operate on a list of modified and new files, excluding
@# deleted and ignored files. git-ls-files can't do this alone. comm -23 takes
@# two files and prints the union, dropping lines common to both (-3) and
Expand Down
2 changes: 1 addition & 1 deletion README.md
Original file line number Diff line number Diff line change
Expand Up @@ -12,7 +12,7 @@ between gRPC, gRPC-Web, Connect, or REST, Vanguard has got you covered. With sup
Google's [HTTP transcoding options](https://github.com/googleapis/googleapis/blob/master/google/api/http.proto#L44),
it can effortlessly translate protocols using strongly typed Protobuf definitions.

[See an example in action!](internal/examples/fileserver/main.go)
[See an example in action!](examples/fileserver/main.go)

## Why Vanguard?

Expand Down
2 changes: 1 addition & 1 deletion buf.work.yaml
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
version: v1
directories:
- internal/proto
- internal/examples/pets/internal/proto
- examples/pets/proto
File renamed without changes.
File renamed without changes.
File renamed without changes.
Original file line number Diff line number Diff line change
@@ -1,9 +1,9 @@
module connectrpc.com/vanguard/internal/examples/connect+grpc
module connectrpc.com/vanguard/examples/connect+grpc

go 1.20

// once the repo is public, we can remove this
replace connectrpc.com/vanguard => ../../../
replace connectrpc.com/vanguard => ../../

require (
buf.build/gen/go/connectrpc/eliza/connectrpc/go v1.11.1-20230822171018-8b8b971d6fde.1
Expand Down
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@ version: v1
managed:
enabled: true
go_package_prefix:
default: connectrpc.com/vanguard/internal/examples/pets/internal/gen
default: connectrpc.com/vanguard/internal/gen
except:
- buf.build/googleapis/googleapis
plugins:
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -30,8 +30,8 @@ import (

"connectrpc.com/grpcreflect"
"connectrpc.com/vanguard"
"connectrpc.com/vanguard/internal/examples/pets/internal"
"connectrpc.com/vanguard/internal/examples/pets/internal/gen/io/swagger/petstore/v2/petstorev2connect"
"connectrpc.com/vanguard/examples/pets/internal"
"connectrpc.com/vanguard/internal/gen/io/swagger/petstore/v2/petstorev2connect"
"golang.org/x/net/http2"
"golang.org/x/net/http2/h2c"
"golang.org/x/sync/errgroup"
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -32,8 +32,8 @@ import (

"connectrpc.com/grpcreflect"
"connectrpc.com/vanguard"
"connectrpc.com/vanguard/internal/examples/pets/internal"
"connectrpc.com/vanguard/internal/examples/pets/internal/gen/io/swagger/petstore/v2/petstorev2connect"
"connectrpc.com/vanguard/examples/pets/internal"
"connectrpc.com/vanguard/internal/gen/io/swagger/petstore/v2/petstorev2connect"
"golang.org/x/net/http2"
"golang.org/x/net/http2/h2c"
"golang.org/x/sync/errgroup"
Expand Down
4 changes: 2 additions & 2 deletions internal/examples/pets/go.mod → examples/pets/go.mod
Original file line number Diff line number Diff line change
@@ -1,9 +1,9 @@
module connectrpc.com/vanguard/internal/examples/pets
module connectrpc.com/vanguard/examples/pets

go 1.20

// once the repo is public, we can remove this
replace connectrpc.com/vanguard => ../../../
replace connectrpc.com/vanguard => ../../

require (
connectrpc.com/connect v1.11.0
Expand Down
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
4 changes: 2 additions & 2 deletions go.work
Original file line number Diff line number Diff line change
Expand Up @@ -2,6 +2,6 @@ go 1.20

use (
.
./internal/examples/connect+grpc
./internal/examples/pets
./examples/connect+grpc
./examples/pets
)

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

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

4 changes: 2 additions & 2 deletions internal/proto/buf.lock
Original file line number Diff line number Diff line change
Expand Up @@ -4,5 +4,5 @@ deps:
- remote: buf.build
owner: googleapis
repository: googleapis
commit: 711e289f6a384c4caeebaff7c6931ade
digest: shake256:e08fb55dad7469f69df00304eed31427d2d1576e9aab31e6bf86642688e04caaf0372f15fe6974cf79432779a635b3ea401ca69c943976dc42749524e4c25d94
commit: 28151c0d0a1641bf938a7672c500e01d
digest: shake256:49215edf8ef57f7863004539deff8834cfb2195113f0b890dd1f67815d9353e28e668019165b9d872395871eeafcbab3ccfdb2b5f11734d3cca95be9e8d139de

0 comments on commit 1404a29

Please sign in to comment.