当前位置: 首页>>代码示例>>Golang>>正文


Golang grpc.Invoke函数代码示例

本文整理汇总了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
	}
}
开发者ID:jmank88,项目名称:kit,代码行数:29,代码来源:client.go

示例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
}
开发者ID:kshlm,项目名称:glusterd2,代码行数:8,代码来源:peer-rpc.pb.go

示例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
}
开发者ID:philips,项目名称:hacks,代码行数:8,代码来源:service.pb.go

示例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
}
开发者ID:jmhodges,项目名称:howsmyssl,代码行数:8,代码来源:logging.pb.go

示例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
}
开发者ID:aaijazi,项目名称:vitess,代码行数:8,代码来源:mysqlctl.pb.go

示例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
}
开发者ID:JohanSJA,项目名称:grpc-gateway,代码行数:8,代码来源:flow_combination.pb.go

示例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
}
开发者ID:CocoaWang,项目名称:grpc-go,代码行数:8,代码来源:route_guide.pb.go

示例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
}
开发者ID:TheThingsNetwork,项目名称:ttn,代码行数:8,代码来源:device.pb.go

示例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
}
开发者ID:eandbsoftware,项目名称:go-micro-services,代码行数:8,代码来源:geo.pb.go

示例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
}
开发者ID:takbok,项目名称:shared-contacts-admin,代码行数:8,代码来源:datastore.pb.go

示例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
}
开发者ID:takbok,项目名称:shared-contacts-admin,代码行数:8,代码来源:datastore.pb.go

示例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
}
开发者ID:postfix,项目名称:coname,代码行数:8,代码来源:verifier.pb.go

示例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
}
开发者ID:golanghr,项目名称:platform-users,代码行数:8,代码来源:user.pb.go

示例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
}
开发者ID:jfrazelle,项目名称:s3server,代码行数:8,代码来源:bytestream.pb.go

示例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
}
开发者ID:kshlm,项目名称:glusterd2,代码行数:8,代码来源:peer-rpc.pb.go


注:本文中的google/golang.org/grpc.Invoke函数示例由纯净天空整理自Github/MSDocs等开源代码及文档管理平台,相关代码片段筛选自各路编程大神贡献的开源项目,源码版权归原作者所有,传播和使用请参考对应项目的License;未经允许,请勿转载。