Support grpc call, grpc document and grpc mock server
It's an extension for
yaml-scene
- Create testcases to test gRPC
- Make gRPC call to others
- Create a mock gRPC server
- Serve static gRPC response data
- Build handler for yourself by code
- Generate gRPC document
- Platform
yaml-scene
yas add yas-grpc # npm install -g yas-grpc OR yard global add yas-grpc
Make a gGPC call to another
- yas-grpc/Call:
proto: ./proto/server.proto
package: user
service: UserService
method: GetUsers
address: 0.0.0.0:5000
request: {
"name": "thanh"
}
Create a gRPC server to mock data
- yas-grpc/Server:
address: 0.0.0.0:5000
packages:
user:
proto: ./proto/server.proto
services:
UserService:
GetUsers: {
code: 1,
data: [{name: 'thanh', age: 1}]
}
- yas-grpc/Server:
address: 0.0.0.0:5000
packages:
user:
proto: ./proto/server.proto
services:
UserService:
GetCustomers: !function |
const merge = require('lodash.merge')
return merge({
name: this.request.name
}, {
age: 10
})
Document all of yas-grpc/Call which got property doc
is true
or { tags: [] }
- yas-grpc/Doc/MD:
title: User gRPC Service
description: Demo CRUD gRPC to generate to markdown document
signature: "[Doan Thuan Thanh](mailto:doanthuanthanh88@gmail.com)"
outFile: ${join(__dirname, 'grpc_document_details.md')}
Collect information of gRPC calls
yas-grpc/Summary:
title: Testing result