The gRPC plugin generates a ServiceNameClient interface like this one:
// MultiPaxosClient is the client API for MultiPaxos service.
//
// For semantics around ctx use and closing/ending streaming RPCs, please refer to https://pkg.go.dev/google.golang.org/grpc/?tab=doc#ClientConn.NewStream.
type MultiPaxosClient interface {
Prepare(ctx context.Context, in *PrepareMsg, opts ...grpc.CallOption) (*PromiseMsg, error)
Accept(ctx context.Context, in *AcceptMsg, opts ...grpc.CallOption) (*LearnMsg, error)
Commit(ctx context.Context, in *LearnMsg, opts ...grpc.CallOption) (*Empty, error)
ClientHandle(ctx context.Context, in *Value, opts ...grpc.CallOption) (*Response, error)
}
Such an interface can be useful for testing.
Since the Gorums plugin replaces the gRPC plugin because it generates overlapping types, we should provide the relevant interface as part of code generation in the _gorums.pb.go file. This should be straightforward since we already generate methods on the Configuration type, such as this one:
The gRPC plugin generates a
ServiceNameClient
interface like this one:Such an interface can be useful for testing.
Since the Gorums plugin replaces the gRPC plugin because it generates overlapping types, we should provide the relevant interface as part of code generation in the
_gorums.pb.go
file. This should be straightforward since we already generate methods on theConfiguration
type, such as this one:We already generate the corresponding server-side interface here: