Add missing GRPC data field (#412)
* feat(grpc): add support for data field in request body * docs: update Readme with embedmd
This commit is contained in:
@@ -2,6 +2,7 @@ package main
|
||||
|
||||
import (
|
||||
"context"
|
||||
structpb "github.com/golang/protobuf/ptypes/struct"
|
||||
"log"
|
||||
|
||||
"github.com/appleboy/gorush/rpc/proto"
|
||||
@@ -36,6 +37,16 @@ func main() {
|
||||
LocKey: "Test loc key",
|
||||
LocArgs: []string{"test", "test"},
|
||||
},
|
||||
Data: &structpb.Struct{
|
||||
Fields: map[string]*structpb.Value{
|
||||
"key1": {
|
||||
Kind: &structpb.Value_StringValue{StringValue: "welcome"},
|
||||
},
|
||||
"key2": {
|
||||
Kind: &structpb.Value_NumberValue{NumberValue: 2},
|
||||
},
|
||||
},
|
||||
},
|
||||
})
|
||||
if err != nil {
|
||||
log.Fatalf("could not greet: %v", err)
|
||||
|
||||
Reference in New Issue
Block a user