Changelog
v0.62.0 - 2020-10-25
- [feature] [option] adding a func as a option to randomize each request #236
Example
func dataFunc(mtd *desc.MethodDescriptor, cd *runner.CallData) []byte {
msg := &helloworld.HelloRequest{}
msg.Name = cd.WorkerID
binData, err := proto.Marshal(msg)
return binData
}
report, err := runner.Run(
"helloworld.Greeter.SayHello",
"0.0.0.0:50051",
runner.WithProtoFile("./testdata/greeter.proto", []string{}),
runner.WithInsecure(true),
runner.WithBinaryDataFunc(dataFunc),
)