@@ -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- - [ pluginrpc- example-server ] ( internal/example/cmd/pluginrpc- example-server ) : An implementation of a
24+ - [ example-plugin ] ( internal/example/cmd/example-plugin ) : An implementation of a
2525 PluginRPC plugin for ` EchoService ` .
26- - [ pluginrpc- example-client-request] ( internal/example/cmd/pluginrpc- example-client-request ) : A
27- simple client that calls the ` EchoRequest ` RPC via invoking ` pluginrpc- example-server ` .
28- - [ pluginrpc- example-client-list] ( internal/example/cmd/pluginrpc- example-client-request ) : A simple
29- client that calls the ` EchoList ` RPC via invoking ` pluginrpc- example-server ` .
30- - [ pluginrpc- example-client-error] ( internal/example/cmd/pluginrpc- example-client-error ) : A simple
31- client that calls the ` EchoError ` RPC via invoking ` pluginrpc- example-server ` .
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 ` .
3232
3333## Usage
3434
@@ -64,7 +64,7 @@ plugins:
6464 opt : paths=source_relative
6565` ` `
6666
67- Build your plugin. See [pluginrpc- example-server ](internal/example/cmd/pluginrpc- example-server ) for
67+ Build your plugin. See [example-plugin ](internal/example/cmd/example-plugin ) for
6868a full example. Assuming you intend to expose the ` EchoService` as a plugin, your code will look
6969something like this :
7070
@@ -76,6 +76,12 @@ func main() {
7676func newServer() (pluginrpc.Server, error) {
7777 spec, err := examplev1pluginrpc.EchoServiceSpecBuilder{
7878 // Note that EchoList does not have optional args and will default to path being the only arg.
79+ //
80+ // This means that the following commands will invoke their respective procedures:
81+ //
82+ // example-plugin echo request
83+ // example-plugin /pluginrpc.example.v1.EchoService/EchoList
84+ // example-plugin echo error
7985 EchoRequest: []pluginrpc.ProcedureOption{pluginrpc.ProcedureWithArgs("echo", "request")},
8086 EchoError: []pluginrpc.ProcedureOption{pluginrpc.ProcedureWithArgs("echo", "error")},
8187 }.Build()
@@ -104,11 +110,11 @@ func (echoServiceHandler) EchoError(_ context.Context, request *examplev1.EchoEr
104110` ` `
105111
106112Invoke your plugin. You'll create a client that points to your plugin. See
107- [pluginrpc- example-client-request](internal/example/cmd/pluginrpc- example-client-request) for a full
113+ [example-client-echo- request](internal/example/cmd/example-client-echo -request) for a full
108114example. Invocation will look something like this :
109115
110116` ` ` go
111- client := pluginrpc.NewClient(pluginrpc.NewExecRunner("pluginrpc- example-server "))
117+ client := pluginrpc.NewClient(pluginrpc.NewExecRunner("example-plugin "))
112118echoServiceClient, err := examplev1pluginrpc.NewEchoServiceClient(client)
113119if err != nil {
114120 return err
0 commit comments