Skip to content

Commit a9f491d

Browse files
committed
Move example binaries
1 parent ffb24bd commit a9f491d

File tree

8 files changed

+32
-32
lines changed

8 files changed

+32
-32
lines changed

.gitignore

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -4,7 +4,7 @@
44
cover.out
55

66
/cmd/protoc-gen-pluginrpc-go/protoc-gen-pluginrpc-go
7-
/internal/example/cmd/example-client-echo-error/example-client-echo-error
8-
/internal/example/cmd/example-client-echo-list/example-client-echo-list
9-
/internal/example/cmd/example-client-echo-request/example-client-echo-request
10-
/internal/example/cmd/example-plugin/example-plugin
7+
/internal/example/cmd/echo-error-client/echo-error-client
8+
/internal/example/cmd/echo-list-client/echo-list-client
9+
/internal/example/cmd/echo-plugin/echo-plugin
10+
/internal/example/cmd/echo-request-client/echo-request-client

Makefile

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -32,7 +32,7 @@ clean: ## Delete intermediate build artifacts
3232
git clean -Xdf
3333

3434
.PHONY: test
35-
test: build $(BIN)/example-plugin ## Run unit tests
35+
test: build $(BIN)/echo-plugin ## Run unit tests
3636
go test -vet=off -race -cover ./...
3737

3838
.PHONY: build
@@ -91,7 +91,7 @@ $(BIN)/protoc-gen-pluginrpc-go:
9191
@mkdir -p $(@D)
9292
go build -o $(@) ./cmd/protoc-gen-pluginrpc-go
9393

94-
.PHONY: $(BIN)/example-plugin
95-
$(BIN)/example-plugin:
94+
.PHONY: $(BIN)/echo-plugin
95+
$(BIN)/echo-plugin:
9696
@mkdir -p $(@D)
97-
go build -o $(@) ./internal/example/cmd/example-plugin
97+
go build -o $(@) ./internal/example/cmd/echo-plugin

README.md

Lines changed: 13 additions & 13 deletions
Original file line numberDiff line numberDiff line change
@@ -21,14 +21,14 @@ For a full example, see the [internal/example](internal/example) directory. This
2121
package that contains an example Protobuf service `EchoService`.
2222
- [gen/pluginrpc/example/v1](internal/example/gen/pluginrpc/example/v1): The generated code
2323
from `protoc-gen-go` and `protoc-gen-pluginrpc-go` for the example Protobuf Package.
24-
- [example-plugin](internal/example/cmd/example-plugin): An implementation of a
24+
- [echo-plugin](internal/example/cmd/echo-plugin): An implementation of a
2525
PluginRPC plugin for `EchoService`.
26-
- [example-client-echo-request](internal/example/cmd/example-client-echo-request): A
27-
simple client that calls the `EchoRequest` RPC via invoking `example-plugin`.
28-
- [example-client-echo-list](internal/example/cmd/example-client-echo-request): A simple
29-
client that calls the `EchoList` RPC via invoking `example-plugin`.
30-
- [example-client-echo-error](internal/example/cmd/example-client-echo-error): A simple
31-
client that calls the `EchoError` RPC via invoking `example-plugin`.
26+
- [echo-request-client](internal/example/cmd/echo-request-client): A
27+
simple client that calls the `EchoRequest` RPC via invoking `echo-plugin`.
28+
- [echo-list-client](internal/example/cmd/echo-request-client): A simple
29+
client that calls the `EchoList` RPC via invoking `echo-plugin`.
30+
- [echo-error-client](internal/example/cmd/echo-error-client): A simple
31+
client that calls the `EchoError` RPC via invoking `echo-plugin`.
3232

3333
## Usage
3434

@@ -64,7 +64,7 @@ plugins:
6464
opt: paths=source_relative
6565
```
6666
67-
Build your plugin. See [example-plugin](internal/example/cmd/example-plugin) for
67+
Build your plugin. See [echo-plugin](internal/example/cmd/echo-plugin) for
6868
a full example. Assuming you intend to expose the `EchoService` as a plugin, your code will look
6969
something like this:
7070

@@ -79,9 +79,9 @@ func newServer() (pluginrpc.Server, error) {
7979
//
8080
// This means that the following commands will invoke their respective procedures:
8181
//
82-
// example-plugin echo request
83-
// example-plugin /pluginrpc.example.v1.EchoService/EchoList
84-
// example-plugin echo error
82+
// echo-plugin echo request
83+
// echo-plugin /pluginrpc.example.v1.EchoService/EchoList
84+
// echo-plugin echo error
8585
EchoRequest: []pluginrpc.ProcedureOption{pluginrpc.ProcedureWithArgs("echo", "request")},
8686
EchoError: []pluginrpc.ProcedureOption{pluginrpc.ProcedureWithArgs("echo", "error")},
8787
}.Build()
@@ -110,11 +110,11 @@ func (echoServiceHandler) EchoError(_ context.Context, request *examplev1.EchoEr
110110
```
111111

112112
Invoke your plugin. You'll create a client that points to your plugin. See
113-
[example-client-echo-request](internal/example/cmd/example-client-echo-request) for a full
113+
[echo-request-client](internal/example/cmd/echo-request-client) for a full
114114
example. Invocation will look something like this:
115115

116116
```go
117-
client := pluginrpc.NewClient(pluginrpc.NewExecRunner("example-plugin"))
117+
client := pluginrpc.NewClient(pluginrpc.NewExecRunner("echo-plugin"))
118118
echoServiceClient, err := examplev1pluginrpc.NewEchoServiceClient(client)
119119
if err != nil {
120120
return err

internal/example/cmd/example-client-echo-error/main.go renamed to internal/example/cmd/echo-error-client/main.go

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -13,7 +13,7 @@
1313
// limitations under the License.
1414

1515
// Package main implements a client that calls the EchoError RPC on the
16-
// example-plugin plugin.
16+
// echo-plugin plugin.
1717
//
1818
// This will parse the first arg as an error Code, and all further args will
1919
// comprise the error message.
@@ -41,7 +41,7 @@ func main() {
4141
}
4242

4343
func run() error {
44-
client := pluginrpc.NewClient(pluginrpc.NewExecRunner("example-plugin"))
44+
client := pluginrpc.NewClient(pluginrpc.NewExecRunner("echo-plugin"))
4545
echoServiceClient, err := examplev1pluginrpc.NewEchoServiceClient(client)
4646
if err != nil {
4747
return err

internal/example/cmd/example-client-echo-list/main.go renamed to internal/example/cmd/echo-list-client/main.go

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -13,7 +13,7 @@
1313
// limitations under the License.
1414

1515
// Package main implements a client that calls the EchoList RPC on the
16-
// example-plugin plugin.
16+
// echo-plugin plugin.
1717
//
1818
// This will echo the list produded by EchoList.
1919
package main
@@ -37,7 +37,7 @@ func main() {
3737
}
3838

3939
func run() error {
40-
client := pluginrpc.NewClient(pluginrpc.NewExecRunner("example-plugin"))
40+
client := pluginrpc.NewClient(pluginrpc.NewExecRunner("echo-plugin"))
4141
echoServiceClient, err := examplev1pluginrpc.NewEchoServiceClient(client)
4242
if err != nil {
4343
return err

internal/example/cmd/example-plugin/main.go renamed to internal/example/cmd/echo-plugin/main.go

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -37,9 +37,9 @@ func newServer() (pluginrpc.Server, error) {
3737
//
3838
// This means that the following commands will invoke their respective procedures:
3939
//
40-
// example-plugin echo request
41-
// example-plugin /pluginrpc.example.v1.EchoService/EchoList
42-
// example-plugin echo error
40+
// echo-plugin echo request
41+
// echo-plugin /pluginrpc.example.v1.EchoService/EchoList
42+
// echo-plugin echo error
4343
EchoRequest: []pluginrpc.ProcedureOption{pluginrpc.ProcedureWithArgs("echo", "request")},
4444
EchoError: []pluginrpc.ProcedureOption{pluginrpc.ProcedureWithArgs("echo", "error")},
4545
}.Build()

internal/example/cmd/example-client-echo-request/main.go renamed to internal/example/cmd/echo-request-client/main.go

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -13,7 +13,7 @@
1313
// limitations under the License.
1414

1515
// Package main implements a client that calls the EchoRequest RPC on the
16-
// example-plugin plugin.
16+
// echo-plugin plugin.
1717
//
1818
// This will echo back any args given to this client.
1919
package main
@@ -38,7 +38,7 @@ func main() {
3838
}
3939

4040
func run() error {
41-
client := pluginrpc.NewClient(pluginrpc.NewExecRunner("example-plugin"))
41+
client := pluginrpc.NewClient(pluginrpc.NewExecRunner("echo-plugin"))
4242
echoServiceClient, err := examplev1pluginrpc.NewEchoServiceClient(client)
4343
if err != nil {
4444
return err

pluginrpc_test.go

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -28,7 +28,7 @@ import (
2828
"pluginrpc.com/pluginrpc/internal/example/gen/pluginrpc/example/v1/examplev1pluginrpc"
2929
)
3030

31-
const echoServicePluginProgramName = "example-plugin"
31+
const echoPluginProgramName = "echo-plugin"
3232

3333
// We want to append 0 so that we call pluginrpc.ClientWithFormat with the default Format.
3434
var allTestFormats = append(slices.Clone(pluginrpc.AllFormats), 0)
@@ -128,7 +128,7 @@ func forEachDimension(t *testing.T, f func(*testing.T, pluginrpc.Client)) {
128128
}
129129

130130
func newExecRunnerClient(clientOptions ...pluginrpc.ClientOption) (pluginrpc.Client, error) {
131-
return pluginrpc.NewClient(pluginrpc.NewExecRunner(echoServicePluginProgramName), clientOptions...), nil
131+
return pluginrpc.NewClient(pluginrpc.NewExecRunner(echoPluginProgramName), clientOptions...), nil
132132
}
133133

134134
func newServerRunnerClient(clientOptions ...pluginrpc.ClientOption) (pluginrpc.Client, error) {

0 commit comments

Comments
 (0)