1 Star 0 Fork 0

StudySpace/uess-protobuf

加入 Gitee
与超过 1200万 开发者一起发现、参与优秀开源项目,私有仓库也完全免费 :)
免费加入
克隆/下载
uess-agent_grpc.pb.go 8.84 KB
一键复制 编辑 原始数据 按行查看 历史
木子金兑 提交于 2024-03-20 10:18 . feat: update api
// Code generated by protoc-gen-go-grpc. DO NOT EDIT.
// versions:
// - protoc-gen-go-grpc v1.3.0
// - protoc v4.23.1
// source: uess-agent.proto
package pb
import (
context "context"
grpc "google.golang.org/grpc"
codes "google.golang.org/grpc/codes"
status "google.golang.org/grpc/status"
)
// This is a compile-time assertion to ensure that this generated file
// is compatible with the grpc package it is being compiled against.
// Requires gRPC-Go v1.32.0 or later.
const _ = grpc.SupportPackageIsVersion7
const (
AgentRpcServer_Ping_FullMethodName = "/pb.AgentRpcServer/Ping"
AgentRpcServer_Heartbeat_FullMethodName = "/pb.AgentRpcServer/Heartbeat"
AgentRpcServer_StartApp_FullMethodName = "/pb.AgentRpcServer/StartApp"
AgentRpcServer_StopApp_FullMethodName = "/pb.AgentRpcServer/StopApp"
)
// AgentRpcServerClient is the client API for AgentRpcServer service.
//
// For semantics around ctx use and closing/ending streaming RPCs, please refer to https://pkg.go.dev/google.golang.org/grpc/?tab=doc#ClientConn.NewStream.
type AgentRpcServerClient interface {
// 测试连接
Ping(ctx context.Context, in *UESSRpcPingRequest, opts ...grpc.CallOption) (*UESSRpcPingResponse, error)
// 心跳
Heartbeat(ctx context.Context, in *UESSHeartbeatRequest, opts ...grpc.CallOption) (AgentRpcServer_HeartbeatClient, error)
// 启动应用
StartApp(ctx context.Context, in *UESSStartAppRequest, opts ...grpc.CallOption) (*UESSStartAppResponse, error)
// 停止应用
StopApp(ctx context.Context, in *UESSStopAppRequest, opts ...grpc.CallOption) (*UESSStopAppResponse, error)
}
type agentRpcServerClient struct {
cc grpc.ClientConnInterface
}
func NewAgentRpcServerClient(cc grpc.ClientConnInterface) AgentRpcServerClient {
return &agentRpcServerClient{cc}
}
func (c *agentRpcServerClient) Ping(ctx context.Context, in *UESSRpcPingRequest, opts ...grpc.CallOption) (*UESSRpcPingResponse, error) {
out := new(UESSRpcPingResponse)
err := c.cc.Invoke(ctx, AgentRpcServer_Ping_FullMethodName, in, out, opts...)
if err != nil {
return nil, err
}
return out, nil
}
func (c *agentRpcServerClient) Heartbeat(ctx context.Context, in *UESSHeartbeatRequest, opts ...grpc.CallOption) (AgentRpcServer_HeartbeatClient, error) {
stream, err := c.cc.NewStream(ctx, &AgentRpcServer_ServiceDesc.Streams[0], AgentRpcServer_Heartbeat_FullMethodName, opts...)
if err != nil {
return nil, err
}
x := &agentRpcServerHeartbeatClient{stream}
if err := x.ClientStream.SendMsg(in); err != nil {
return nil, err
}
if err := x.ClientStream.CloseSend(); err != nil {
return nil, err
}
return x, nil
}
type AgentRpcServer_HeartbeatClient interface {
Recv() (*UESSHeartbeatResponse, error)
grpc.ClientStream
}
type agentRpcServerHeartbeatClient struct {
grpc.ClientStream
}
func (x *agentRpcServerHeartbeatClient) Recv() (*UESSHeartbeatResponse, error) {
m := new(UESSHeartbeatResponse)
if err := x.ClientStream.RecvMsg(m); err != nil {
return nil, err
}
return m, nil
}
func (c *agentRpcServerClient) StartApp(ctx context.Context, in *UESSStartAppRequest, opts ...grpc.CallOption) (*UESSStartAppResponse, error) {
out := new(UESSStartAppResponse)
err := c.cc.Invoke(ctx, AgentRpcServer_StartApp_FullMethodName, in, out, opts...)
if err != nil {
return nil, err
}
return out, nil
}
func (c *agentRpcServerClient) StopApp(ctx context.Context, in *UESSStopAppRequest, opts ...grpc.CallOption) (*UESSStopAppResponse, error) {
out := new(UESSStopAppResponse)
err := c.cc.Invoke(ctx, AgentRpcServer_StopApp_FullMethodName, in, out, opts...)
if err != nil {
return nil, err
}
return out, nil
}
// AgentRpcServerServer is the server API for AgentRpcServer service.
// All implementations must embed UnimplementedAgentRpcServerServer
// for forward compatibility
type AgentRpcServerServer interface {
// 测试连接
Ping(context.Context, *UESSRpcPingRequest) (*UESSRpcPingResponse, error)
// 心跳
Heartbeat(*UESSHeartbeatRequest, AgentRpcServer_HeartbeatServer) error
// 启动应用
StartApp(context.Context, *UESSStartAppRequest) (*UESSStartAppResponse, error)
// 停止应用
StopApp(context.Context, *UESSStopAppRequest) (*UESSStopAppResponse, error)
mustEmbedUnimplementedAgentRpcServerServer()
}
// UnimplementedAgentRpcServerServer must be embedded to have forward compatible implementations.
type UnimplementedAgentRpcServerServer struct {
}
func (UnimplementedAgentRpcServerServer) Ping(context.Context, *UESSRpcPingRequest) (*UESSRpcPingResponse, error) {
return nil, status.Errorf(codes.Unimplemented, "method Ping not implemented")
}
func (UnimplementedAgentRpcServerServer) Heartbeat(*UESSHeartbeatRequest, AgentRpcServer_HeartbeatServer) error {
return status.Errorf(codes.Unimplemented, "method Heartbeat not implemented")
}
func (UnimplementedAgentRpcServerServer) StartApp(context.Context, *UESSStartAppRequest) (*UESSStartAppResponse, error) {
return nil, status.Errorf(codes.Unimplemented, "method StartApp not implemented")
}
func (UnimplementedAgentRpcServerServer) StopApp(context.Context, *UESSStopAppRequest) (*UESSStopAppResponse, error) {
return nil, status.Errorf(codes.Unimplemented, "method StopApp not implemented")
}
func (UnimplementedAgentRpcServerServer) mustEmbedUnimplementedAgentRpcServerServer() {}
// UnsafeAgentRpcServerServer may be embedded to opt out of forward compatibility for this service.
// Use of this interface is not recommended, as added methods to AgentRpcServerServer will
// result in compilation errors.
type UnsafeAgentRpcServerServer interface {
mustEmbedUnimplementedAgentRpcServerServer()
}
func RegisterAgentRpcServerServer(s grpc.ServiceRegistrar, srv AgentRpcServerServer) {
s.RegisterService(&AgentRpcServer_ServiceDesc, srv)
}
func _AgentRpcServer_Ping_Handler(srv interface{}, ctx context.Context, dec func(interface{}) error, interceptor grpc.UnaryServerInterceptor) (interface{}, error) {
in := new(UESSRpcPingRequest)
if err := dec(in); err != nil {
return nil, err
}
if interceptor == nil {
return srv.(AgentRpcServerServer).Ping(ctx, in)
}
info := &grpc.UnaryServerInfo{
Server: srv,
FullMethod: AgentRpcServer_Ping_FullMethodName,
}
handler := func(ctx context.Context, req interface{}) (interface{}, error) {
return srv.(AgentRpcServerServer).Ping(ctx, req.(*UESSRpcPingRequest))
}
return interceptor(ctx, in, info, handler)
}
func _AgentRpcServer_Heartbeat_Handler(srv interface{}, stream grpc.ServerStream) error {
m := new(UESSHeartbeatRequest)
if err := stream.RecvMsg(m); err != nil {
return err
}
return srv.(AgentRpcServerServer).Heartbeat(m, &agentRpcServerHeartbeatServer{stream})
}
type AgentRpcServer_HeartbeatServer interface {
Send(*UESSHeartbeatResponse) error
grpc.ServerStream
}
type agentRpcServerHeartbeatServer struct {
grpc.ServerStream
}
func (x *agentRpcServerHeartbeatServer) Send(m *UESSHeartbeatResponse) error {
return x.ServerStream.SendMsg(m)
}
func _AgentRpcServer_StartApp_Handler(srv interface{}, ctx context.Context, dec func(interface{}) error, interceptor grpc.UnaryServerInterceptor) (interface{}, error) {
in := new(UESSStartAppRequest)
if err := dec(in); err != nil {
return nil, err
}
if interceptor == nil {
return srv.(AgentRpcServerServer).StartApp(ctx, in)
}
info := &grpc.UnaryServerInfo{
Server: srv,
FullMethod: AgentRpcServer_StartApp_FullMethodName,
}
handler := func(ctx context.Context, req interface{}) (interface{}, error) {
return srv.(AgentRpcServerServer).StartApp(ctx, req.(*UESSStartAppRequest))
}
return interceptor(ctx, in, info, handler)
}
func _AgentRpcServer_StopApp_Handler(srv interface{}, ctx context.Context, dec func(interface{}) error, interceptor grpc.UnaryServerInterceptor) (interface{}, error) {
in := new(UESSStopAppRequest)
if err := dec(in); err != nil {
return nil, err
}
if interceptor == nil {
return srv.(AgentRpcServerServer).StopApp(ctx, in)
}
info := &grpc.UnaryServerInfo{
Server: srv,
FullMethod: AgentRpcServer_StopApp_FullMethodName,
}
handler := func(ctx context.Context, req interface{}) (interface{}, error) {
return srv.(AgentRpcServerServer).StopApp(ctx, req.(*UESSStopAppRequest))
}
return interceptor(ctx, in, info, handler)
}
// AgentRpcServer_ServiceDesc is the grpc.ServiceDesc for AgentRpcServer service.
// It's only intended for direct use with grpc.RegisterService,
// and not to be introspected or modified (even as a copy)
var AgentRpcServer_ServiceDesc = grpc.ServiceDesc{
ServiceName: "pb.AgentRpcServer",
HandlerType: (*AgentRpcServerServer)(nil),
Methods: []grpc.MethodDesc{
{
MethodName: "Ping",
Handler: _AgentRpcServer_Ping_Handler,
},
{
MethodName: "StartApp",
Handler: _AgentRpcServer_StartApp_Handler,
},
{
MethodName: "StopApp",
Handler: _AgentRpcServer_StopApp_Handler,
},
},
Streams: []grpc.StreamDesc{
{
StreamName: "Heartbeat",
Handler: _AgentRpcServer_Heartbeat_Handler,
ServerStreams: true,
},
},
Metadata: "uess-agent.proto",
}
马建仓 AI 助手
尝试更多
代码解读
代码找茬
代码优化
Go
1
https://gitee.com/lrayt-study-space/uess-protobuf.git
git@gitee.com:lrayt-study-space/uess-protobuf.git
lrayt-study-space
uess-protobuf
uess-protobuf
v0.2.8

搜索帮助

23e8dbc6 1850385 7e0993f3 1850385