本文整理汇总了Golang中google/golang.org/grpc.Invoke函数的典型用法代码示例。如果您正苦于以下问题:Golang Invoke函数的具体用法?Golang Invoke怎么用?Golang Invoke使用的例子?那么恭喜您, 这里精选的函数代码示例或许可以为您提供帮助。
在下文中一共展示了Invoke函数的15个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的Golang代码示例。
示例1: Endpoint
// Endpoint returns a usable endpoint that will invoke the gRPC specified by the
// client.
func (c Client) Endpoint() endpoint.Endpoint {
return func(ctx context.Context, request interface{}) (interface{}, error) {
ctx, cancel := context.WithCancel(ctx)
defer cancel()
req, err := c.enc(ctx, request)
if err != nil {
return nil, fmt.Errorf("Encode: %v", err)
}
md := &metadata.MD{}
for _, f := range c.before {
ctx = f(ctx, md)
}
ctx = metadata.NewContext(ctx, *md)
if err = grpc.Invoke(ctx, c.method, req, c.grpcReply, c.client); err != nil {
return nil, fmt.Errorf("Invoke: %v", err)
}
response, err := c.dec(ctx, c.grpcReply)
if err != nil {
return nil, fmt.Errorf("Decode: %v", err)
}
return response, nil
}
}
示例2: ValidateDelete
func (c *peerServiceClient) ValidateDelete(ctx context.Context, in *PeerDeleteReq, opts ...grpc.CallOption) (*PeerGenericResp, error) {
out := new(PeerGenericResp)
err := grpc.Invoke(ctx, "/peercommands.PeerService/ValidateDelete", in, out, c.cc, opts...)
if err != nil {
return nil, err
}
return out, nil
}
示例3: Echo
func (c *yourServiceClient) Echo(ctx context.Context, in *StringMessage, opts ...grpc.CallOption) (*StringMessage, error) {
out := new(StringMessage)
err := grpc.Invoke(ctx, "/play.YourService/Echo", in, out, c.cc, opts...)
if err != nil {
return nil, err
}
return out, nil
}
示例4: ListLogs
func (c *loggingServiceV2Client) ListLogs(ctx context.Context, in *ListLogsRequest, opts ...grpc.CallOption) (*ListLogsResponse, error) {
out := new(ListLogsResponse)
err := grpc.Invoke(ctx, "/google.logging.v2.LoggingServiceV2/ListLogs", in, out, c.cc, opts...)
if err != nil {
return nil, err
}
return out, nil
}
示例5: RunMysqlUpgrade
func (c *mysqlCtlClient) RunMysqlUpgrade(ctx context.Context, in *RunMysqlUpgradeRequest, opts ...grpc.CallOption) (*RunMysqlUpgradeResponse, error) {
out := new(RunMysqlUpgradeResponse)
err := grpc.Invoke(ctx, "/mysqlctl.MysqlCtl/RunMysqlUpgrade", in, out, c.cc, opts...)
if err != nil {
return nil, err
}
return out, nil
}
示例6: RpcPathNestedRpc
func (c *flowCombinationClient) RpcPathNestedRpc(ctx context.Context, in *NestedProto, opts ...grpc.CallOption) (*EmptyProto, error) {
out := new(EmptyProto)
err := grpc.Invoke(ctx, "/gengo.grpc.gateway.examples.examplepb.FlowCombination/RpcPathNestedRpc", in, out, c.cc, opts...)
if err != nil {
return nil, err
}
return out, nil
}
示例7: GetFeature
func (c *routeGuideClient) GetFeature(ctx context.Context, in *Point, opts ...grpc.CallOption) (*Feature, error) {
out := new(Feature)
err := grpc.Invoke(ctx, "/routeguide.RouteGuide/GetFeature", in, out, c.cc, opts...)
if err != nil {
return nil, err
}
return out, nil
}
示例8: GetDevice
func (c *deviceManagerClient) GetDevice(ctx context.Context, in *DeviceIdentifier, opts ...grpc.CallOption) (*Device, error) {
out := new(Device)
err := grpc.Invoke(ctx, "/lorawan.DeviceManager/GetDevice", in, out, c.cc, opts...)
if err != nil {
return nil, err
}
return out, nil
}
示例9: BoundedBox
func (c *geoClient) BoundedBox(ctx context.Context, in *Request, opts ...grpc.CallOption) (*Result, error) {
out := new(Result)
err := grpc.Invoke(ctx, "/geo.Geo/BoundedBox", in, out, c.cc, opts...)
if err != nil {
return nil, err
}
return out, nil
}
示例10: Commit
func (c *datastoreClient) Commit(ctx context.Context, in *CommitRequest, opts ...grpc.CallOption) (*CommitResponse, error) {
out := new(CommitResponse)
err := grpc.Invoke(ctx, "/google.datastore.v1beta3.Datastore/Commit", in, out, c.cc, opts...)
if err != nil {
return nil, err
}
return out, nil
}
示例11: BeginTransaction
func (c *datastoreClient) BeginTransaction(ctx context.Context, in *BeginTransactionRequest, opts ...grpc.CallOption) (*BeginTransactionResponse, error) {
out := new(BeginTransactionResponse)
err := grpc.Invoke(ctx, "/google.datastore.v1beta3.Datastore/BeginTransaction", in, out, c.cc, opts...)
if err != nil {
return nil, err
}
return out, nil
}
示例12: PushRatification
func (c *e2EKSVerificationClient) PushRatification(ctx context.Context, in *SignedEpochHead, opts ...grpc.CallOption) (*Nothing, error) {
out := new(Nothing)
err := grpc.Invoke(ctx, "/proto.E2EKSVerification/PushRatification", in, out, c.cc, opts...)
if err != nil {
return nil, err
}
return out, nil
}
示例13: Profile
func (c *usersClient) Profile(ctx context.Context, in *platform.Request, opts ...grpc.CallOption) (*platform.Response, error) {
out := new(platform.Response)
err := grpc.Invoke(ctx, "/users.Users/Profile", in, out, c.cc, opts...)
if err != nil {
return nil, err
}
return out, nil
}
示例14: QueryWriteStatus
func (c *byteStreamClient) QueryWriteStatus(ctx context.Context, in *QueryWriteStatusRequest, opts ...grpc.CallOption) (*QueryWriteStatusResponse, error) {
out := new(QueryWriteStatusResponse)
err := grpc.Invoke(ctx, "/google.bytestream.ByteStream/QueryWriteStatus", in, out, c.cc, opts...)
if err != nil {
return nil, err
}
return out, nil
}
示例15: ExportAndStoreETCDConfig
func (c *peerServiceClient) ExportAndStoreETCDConfig(ctx context.Context, in *EtcdConfigReq, opts ...grpc.CallOption) (*PeerGenericResp, error) {
out := new(PeerGenericResp)
err := grpc.Invoke(ctx, "/peercommands.PeerService/ExportAndStoreETCDConfig", in, out, c.cc, opts...)
if err != nil {
return nil, err
}
return out, nil
}