| // Code generated by protoc-gen-go-grpc. DO NOT EDIT. |
| // versions: |
| // - protoc-gen-go-grpc v1.2.0 |
| // - protoc v3.21.7 |
| // source: go.chromium.org/luci/swarming/internal/remoteworkers/bots.proto |
| |
| package remoteworkers |
| |
| 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 |
| |
| // BotsClient is the client API for Bots 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 BotsClient interface { |
| // CreateBotSession is called when the bot first joins the farm, and |
| // establishes a session ID to ensure that multiple machines do not register |
| // using the same name accidentally. |
| CreateBotSession(ctx context.Context, in *CreateBotSessionRequest, opts ...grpc.CallOption) (*BotSession, error) |
| // UpdateBotSession must be called periodically by the bot (on a schedule |
| // determined by the server) to let the server know about its status, and to |
| // pick up new lease requests from the server. |
| UpdateBotSession(ctx context.Context, in *UpdateBotSessionRequest, opts ...grpc.CallOption) (*BotSession, error) |
| } |
| |
| type botsClient struct { |
| cc grpc.ClientConnInterface |
| } |
| |
| func NewBotsClient(cc grpc.ClientConnInterface) BotsClient { |
| return &botsClient{cc} |
| } |
| |
| func (c *botsClient) CreateBotSession(ctx context.Context, in *CreateBotSessionRequest, opts ...grpc.CallOption) (*BotSession, error) { |
| out := new(BotSession) |
| err := c.cc.Invoke(ctx, "/google.devtools.remoteworkers.v1test2.Bots/CreateBotSession", in, out, opts...) |
| if err != nil { |
| return nil, err |
| } |
| return out, nil |
| } |
| |
| func (c *botsClient) UpdateBotSession(ctx context.Context, in *UpdateBotSessionRequest, opts ...grpc.CallOption) (*BotSession, error) { |
| out := new(BotSession) |
| err := c.cc.Invoke(ctx, "/google.devtools.remoteworkers.v1test2.Bots/UpdateBotSession", in, out, opts...) |
| if err != nil { |
| return nil, err |
| } |
| return out, nil |
| } |
| |
| // BotsServer is the server API for Bots service. |
| // All implementations must embed UnimplementedBotsServer |
| // for forward compatibility |
| type BotsServer interface { |
| // CreateBotSession is called when the bot first joins the farm, and |
| // establishes a session ID to ensure that multiple machines do not register |
| // using the same name accidentally. |
| CreateBotSession(context.Context, *CreateBotSessionRequest) (*BotSession, error) |
| // UpdateBotSession must be called periodically by the bot (on a schedule |
| // determined by the server) to let the server know about its status, and to |
| // pick up new lease requests from the server. |
| UpdateBotSession(context.Context, *UpdateBotSessionRequest) (*BotSession, error) |
| mustEmbedUnimplementedBotsServer() |
| } |
| |
| // UnimplementedBotsServer must be embedded to have forward compatible implementations. |
| type UnimplementedBotsServer struct { |
| } |
| |
| func (UnimplementedBotsServer) CreateBotSession(context.Context, *CreateBotSessionRequest) (*BotSession, error) { |
| return nil, status.Errorf(codes.Unimplemented, "method CreateBotSession not implemented") |
| } |
| func (UnimplementedBotsServer) UpdateBotSession(context.Context, *UpdateBotSessionRequest) (*BotSession, error) { |
| return nil, status.Errorf(codes.Unimplemented, "method UpdateBotSession not implemented") |
| } |
| func (UnimplementedBotsServer) mustEmbedUnimplementedBotsServer() {} |
| |
| // UnsafeBotsServer may be embedded to opt out of forward compatibility for this service. |
| // Use of this interface is not recommended, as added methods to BotsServer will |
| // result in compilation errors. |
| type UnsafeBotsServer interface { |
| mustEmbedUnimplementedBotsServer() |
| } |
| |
| func RegisterBotsServer(s grpc.ServiceRegistrar, srv BotsServer) { |
| s.RegisterService(&Bots_ServiceDesc, srv) |
| } |
| |
| func _Bots_CreateBotSession_Handler(srv interface{}, ctx context.Context, dec func(interface{}) error, interceptor grpc.UnaryServerInterceptor) (interface{}, error) { |
| in := new(CreateBotSessionRequest) |
| if err := dec(in); err != nil { |
| return nil, err |
| } |
| if interceptor == nil { |
| return srv.(BotsServer).CreateBotSession(ctx, in) |
| } |
| info := &grpc.UnaryServerInfo{ |
| Server: srv, |
| FullMethod: "/google.devtools.remoteworkers.v1test2.Bots/CreateBotSession", |
| } |
| handler := func(ctx context.Context, req interface{}) (interface{}, error) { |
| return srv.(BotsServer).CreateBotSession(ctx, req.(*CreateBotSessionRequest)) |
| } |
| return interceptor(ctx, in, info, handler) |
| } |
| |
| func _Bots_UpdateBotSession_Handler(srv interface{}, ctx context.Context, dec func(interface{}) error, interceptor grpc.UnaryServerInterceptor) (interface{}, error) { |
| in := new(UpdateBotSessionRequest) |
| if err := dec(in); err != nil { |
| return nil, err |
| } |
| if interceptor == nil { |
| return srv.(BotsServer).UpdateBotSession(ctx, in) |
| } |
| info := &grpc.UnaryServerInfo{ |
| Server: srv, |
| FullMethod: "/google.devtools.remoteworkers.v1test2.Bots/UpdateBotSession", |
| } |
| handler := func(ctx context.Context, req interface{}) (interface{}, error) { |
| return srv.(BotsServer).UpdateBotSession(ctx, req.(*UpdateBotSessionRequest)) |
| } |
| return interceptor(ctx, in, info, handler) |
| } |
| |
| // Bots_ServiceDesc is the grpc.ServiceDesc for Bots service. |
| // It's only intended for direct use with grpc.RegisterService, |
| // and not to be introspected or modified (even as a copy) |
| var Bots_ServiceDesc = grpc.ServiceDesc{ |
| ServiceName: "google.devtools.remoteworkers.v1test2.Bots", |
| HandlerType: (*BotsServer)(nil), |
| Methods: []grpc.MethodDesc{ |
| { |
| MethodName: "CreateBotSession", |
| Handler: _Bots_CreateBotSession_Handler, |
| }, |
| { |
| MethodName: "UpdateBotSession", |
| Handler: _Bots_UpdateBotSession_Handler, |
| }, |
| }, |
| Streams: []grpc.StreamDesc{}, |
| Metadata: "go.chromium.org/luci/swarming/internal/remoteworkers/bots.proto", |
| } |