mirror of
https://github.com/hanzoai/tasks.git
synced 2026-11-02 10:43:08 +00:00
## What changed? - Added an RPC service to the CHASM Scheduler which implements its CRUD operations. - The intention is for the frontend handler to attempt to route to CHASM operations in history, and in the event of a not-found, let frontend retry its old (V1 scheduler) path. - These assume frontend's validation. As we move towards ripping out the old scheduler code, we'll start moving all of that existing logic over into the CHASM world, but for now, let's keep it as-is for as light a possible touch on existing paths. - This is based on `standalone-activity` just to get the API boilerplate stuff.
259 lines
11 KiB
Go
259 lines
11 KiB
Go
// Code generated by protoc-gen-go-grpc. DO NOT EDIT.
|
|
// plugins:
|
|
// - protoc-gen-go-grpc
|
|
// - protoc
|
|
// source: temporal/server/chasm/lib/scheduler/proto/v1/service.proto
|
|
|
|
package schedulerpb
|
|
|
|
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 (
|
|
SchedulerService_CreateSchedule_FullMethodName = "/temporal.server.chasm.lib.scheduler.proto.v1.SchedulerService/CreateSchedule"
|
|
SchedulerService_UpdateSchedule_FullMethodName = "/temporal.server.chasm.lib.scheduler.proto.v1.SchedulerService/UpdateSchedule"
|
|
SchedulerService_PatchSchedule_FullMethodName = "/temporal.server.chasm.lib.scheduler.proto.v1.SchedulerService/PatchSchedule"
|
|
SchedulerService_DeleteSchedule_FullMethodName = "/temporal.server.chasm.lib.scheduler.proto.v1.SchedulerService/DeleteSchedule"
|
|
SchedulerService_DescribeSchedule_FullMethodName = "/temporal.server.chasm.lib.scheduler.proto.v1.SchedulerService/DescribeSchedule"
|
|
)
|
|
|
|
// SchedulerServiceClient is the client API for SchedulerService 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 SchedulerServiceClient interface {
|
|
CreateSchedule(ctx context.Context, in *CreateScheduleRequest, opts ...grpc.CallOption) (*CreateScheduleResponse, error)
|
|
UpdateSchedule(ctx context.Context, in *UpdateScheduleRequest, opts ...grpc.CallOption) (*UpdateScheduleResponse, error)
|
|
PatchSchedule(ctx context.Context, in *PatchScheduleRequest, opts ...grpc.CallOption) (*PatchScheduleResponse, error)
|
|
DeleteSchedule(ctx context.Context, in *DeleteScheduleRequest, opts ...grpc.CallOption) (*DeleteScheduleResponse, error)
|
|
DescribeSchedule(ctx context.Context, in *DescribeScheduleRequest, opts ...grpc.CallOption) (*DescribeScheduleResponse, error)
|
|
}
|
|
|
|
type schedulerServiceClient struct {
|
|
cc grpc.ClientConnInterface
|
|
}
|
|
|
|
func NewSchedulerServiceClient(cc grpc.ClientConnInterface) SchedulerServiceClient {
|
|
return &schedulerServiceClient{cc}
|
|
}
|
|
|
|
func (c *schedulerServiceClient) CreateSchedule(ctx context.Context, in *CreateScheduleRequest, opts ...grpc.CallOption) (*CreateScheduleResponse, error) {
|
|
out := new(CreateScheduleResponse)
|
|
err := c.cc.Invoke(ctx, SchedulerService_CreateSchedule_FullMethodName, in, out, opts...)
|
|
if err != nil {
|
|
return nil, err
|
|
}
|
|
return out, nil
|
|
}
|
|
|
|
func (c *schedulerServiceClient) UpdateSchedule(ctx context.Context, in *UpdateScheduleRequest, opts ...grpc.CallOption) (*UpdateScheduleResponse, error) {
|
|
out := new(UpdateScheduleResponse)
|
|
err := c.cc.Invoke(ctx, SchedulerService_UpdateSchedule_FullMethodName, in, out, opts...)
|
|
if err != nil {
|
|
return nil, err
|
|
}
|
|
return out, nil
|
|
}
|
|
|
|
func (c *schedulerServiceClient) PatchSchedule(ctx context.Context, in *PatchScheduleRequest, opts ...grpc.CallOption) (*PatchScheduleResponse, error) {
|
|
out := new(PatchScheduleResponse)
|
|
err := c.cc.Invoke(ctx, SchedulerService_PatchSchedule_FullMethodName, in, out, opts...)
|
|
if err != nil {
|
|
return nil, err
|
|
}
|
|
return out, nil
|
|
}
|
|
|
|
func (c *schedulerServiceClient) DeleteSchedule(ctx context.Context, in *DeleteScheduleRequest, opts ...grpc.CallOption) (*DeleteScheduleResponse, error) {
|
|
out := new(DeleteScheduleResponse)
|
|
err := c.cc.Invoke(ctx, SchedulerService_DeleteSchedule_FullMethodName, in, out, opts...)
|
|
if err != nil {
|
|
return nil, err
|
|
}
|
|
return out, nil
|
|
}
|
|
|
|
func (c *schedulerServiceClient) DescribeSchedule(ctx context.Context, in *DescribeScheduleRequest, opts ...grpc.CallOption) (*DescribeScheduleResponse, error) {
|
|
out := new(DescribeScheduleResponse)
|
|
err := c.cc.Invoke(ctx, SchedulerService_DescribeSchedule_FullMethodName, in, out, opts...)
|
|
if err != nil {
|
|
return nil, err
|
|
}
|
|
return out, nil
|
|
}
|
|
|
|
// SchedulerServiceServer is the server API for SchedulerService service.
|
|
// All implementations must embed UnimplementedSchedulerServiceServer
|
|
// for forward compatibility
|
|
type SchedulerServiceServer interface {
|
|
CreateSchedule(context.Context, *CreateScheduleRequest) (*CreateScheduleResponse, error)
|
|
UpdateSchedule(context.Context, *UpdateScheduleRequest) (*UpdateScheduleResponse, error)
|
|
PatchSchedule(context.Context, *PatchScheduleRequest) (*PatchScheduleResponse, error)
|
|
DeleteSchedule(context.Context, *DeleteScheduleRequest) (*DeleteScheduleResponse, error)
|
|
DescribeSchedule(context.Context, *DescribeScheduleRequest) (*DescribeScheduleResponse, error)
|
|
mustEmbedUnimplementedSchedulerServiceServer()
|
|
}
|
|
|
|
// UnimplementedSchedulerServiceServer must be embedded to have forward compatible implementations.
|
|
type UnimplementedSchedulerServiceServer struct {
|
|
}
|
|
|
|
func (UnimplementedSchedulerServiceServer) CreateSchedule(context.Context, *CreateScheduleRequest) (*CreateScheduleResponse, error) {
|
|
return nil, status.Errorf(codes.Unimplemented, "method CreateSchedule not implemented")
|
|
}
|
|
func (UnimplementedSchedulerServiceServer) UpdateSchedule(context.Context, *UpdateScheduleRequest) (*UpdateScheduleResponse, error) {
|
|
return nil, status.Errorf(codes.Unimplemented, "method UpdateSchedule not implemented")
|
|
}
|
|
func (UnimplementedSchedulerServiceServer) PatchSchedule(context.Context, *PatchScheduleRequest) (*PatchScheduleResponse, error) {
|
|
return nil, status.Errorf(codes.Unimplemented, "method PatchSchedule not implemented")
|
|
}
|
|
func (UnimplementedSchedulerServiceServer) DeleteSchedule(context.Context, *DeleteScheduleRequest) (*DeleteScheduleResponse, error) {
|
|
return nil, status.Errorf(codes.Unimplemented, "method DeleteSchedule not implemented")
|
|
}
|
|
func (UnimplementedSchedulerServiceServer) DescribeSchedule(context.Context, *DescribeScheduleRequest) (*DescribeScheduleResponse, error) {
|
|
return nil, status.Errorf(codes.Unimplemented, "method DescribeSchedule not implemented")
|
|
}
|
|
func (UnimplementedSchedulerServiceServer) mustEmbedUnimplementedSchedulerServiceServer() {}
|
|
|
|
// UnsafeSchedulerServiceServer may be embedded to opt out of forward compatibility for this service.
|
|
// Use of this interface is not recommended, as added methods to SchedulerServiceServer will
|
|
// result in compilation errors.
|
|
type UnsafeSchedulerServiceServer interface {
|
|
mustEmbedUnimplementedSchedulerServiceServer()
|
|
}
|
|
|
|
func RegisterSchedulerServiceServer(s grpc.ServiceRegistrar, srv SchedulerServiceServer) {
|
|
s.RegisterService(&SchedulerService_ServiceDesc, srv)
|
|
}
|
|
|
|
func _SchedulerService_CreateSchedule_Handler(srv interface{}, ctx context.Context, dec func(interface{}) error, interceptor grpc.UnaryServerInterceptor) (interface{}, error) {
|
|
in := new(CreateScheduleRequest)
|
|
if err := dec(in); err != nil {
|
|
return nil, err
|
|
}
|
|
if interceptor == nil {
|
|
return srv.(SchedulerServiceServer).CreateSchedule(ctx, in)
|
|
}
|
|
info := &grpc.UnaryServerInfo{
|
|
Server: srv,
|
|
FullMethod: SchedulerService_CreateSchedule_FullMethodName,
|
|
}
|
|
handler := func(ctx context.Context, req interface{}) (interface{}, error) {
|
|
return srv.(SchedulerServiceServer).CreateSchedule(ctx, req.(*CreateScheduleRequest))
|
|
}
|
|
return interceptor(ctx, in, info, handler)
|
|
}
|
|
|
|
func _SchedulerService_UpdateSchedule_Handler(srv interface{}, ctx context.Context, dec func(interface{}) error, interceptor grpc.UnaryServerInterceptor) (interface{}, error) {
|
|
in := new(UpdateScheduleRequest)
|
|
if err := dec(in); err != nil {
|
|
return nil, err
|
|
}
|
|
if interceptor == nil {
|
|
return srv.(SchedulerServiceServer).UpdateSchedule(ctx, in)
|
|
}
|
|
info := &grpc.UnaryServerInfo{
|
|
Server: srv,
|
|
FullMethod: SchedulerService_UpdateSchedule_FullMethodName,
|
|
}
|
|
handler := func(ctx context.Context, req interface{}) (interface{}, error) {
|
|
return srv.(SchedulerServiceServer).UpdateSchedule(ctx, req.(*UpdateScheduleRequest))
|
|
}
|
|
return interceptor(ctx, in, info, handler)
|
|
}
|
|
|
|
func _SchedulerService_PatchSchedule_Handler(srv interface{}, ctx context.Context, dec func(interface{}) error, interceptor grpc.UnaryServerInterceptor) (interface{}, error) {
|
|
in := new(PatchScheduleRequest)
|
|
if err := dec(in); err != nil {
|
|
return nil, err
|
|
}
|
|
if interceptor == nil {
|
|
return srv.(SchedulerServiceServer).PatchSchedule(ctx, in)
|
|
}
|
|
info := &grpc.UnaryServerInfo{
|
|
Server: srv,
|
|
FullMethod: SchedulerService_PatchSchedule_FullMethodName,
|
|
}
|
|
handler := func(ctx context.Context, req interface{}) (interface{}, error) {
|
|
return srv.(SchedulerServiceServer).PatchSchedule(ctx, req.(*PatchScheduleRequest))
|
|
}
|
|
return interceptor(ctx, in, info, handler)
|
|
}
|
|
|
|
func _SchedulerService_DeleteSchedule_Handler(srv interface{}, ctx context.Context, dec func(interface{}) error, interceptor grpc.UnaryServerInterceptor) (interface{}, error) {
|
|
in := new(DeleteScheduleRequest)
|
|
if err := dec(in); err != nil {
|
|
return nil, err
|
|
}
|
|
if interceptor == nil {
|
|
return srv.(SchedulerServiceServer).DeleteSchedule(ctx, in)
|
|
}
|
|
info := &grpc.UnaryServerInfo{
|
|
Server: srv,
|
|
FullMethod: SchedulerService_DeleteSchedule_FullMethodName,
|
|
}
|
|
handler := func(ctx context.Context, req interface{}) (interface{}, error) {
|
|
return srv.(SchedulerServiceServer).DeleteSchedule(ctx, req.(*DeleteScheduleRequest))
|
|
}
|
|
return interceptor(ctx, in, info, handler)
|
|
}
|
|
|
|
func _SchedulerService_DescribeSchedule_Handler(srv interface{}, ctx context.Context, dec func(interface{}) error, interceptor grpc.UnaryServerInterceptor) (interface{}, error) {
|
|
in := new(DescribeScheduleRequest)
|
|
if err := dec(in); err != nil {
|
|
return nil, err
|
|
}
|
|
if interceptor == nil {
|
|
return srv.(SchedulerServiceServer).DescribeSchedule(ctx, in)
|
|
}
|
|
info := &grpc.UnaryServerInfo{
|
|
Server: srv,
|
|
FullMethod: SchedulerService_DescribeSchedule_FullMethodName,
|
|
}
|
|
handler := func(ctx context.Context, req interface{}) (interface{}, error) {
|
|
return srv.(SchedulerServiceServer).DescribeSchedule(ctx, req.(*DescribeScheduleRequest))
|
|
}
|
|
return interceptor(ctx, in, info, handler)
|
|
}
|
|
|
|
// SchedulerService_ServiceDesc is the grpc.ServiceDesc for SchedulerService service.
|
|
// It's only intended for direct use with grpc.RegisterService,
|
|
// and not to be introspected or modified (even as a copy)
|
|
var SchedulerService_ServiceDesc = grpc.ServiceDesc{
|
|
ServiceName: "temporal.server.chasm.lib.scheduler.proto.v1.SchedulerService",
|
|
HandlerType: (*SchedulerServiceServer)(nil),
|
|
Methods: []grpc.MethodDesc{
|
|
{
|
|
MethodName: "CreateSchedule",
|
|
Handler: _SchedulerService_CreateSchedule_Handler,
|
|
},
|
|
{
|
|
MethodName: "UpdateSchedule",
|
|
Handler: _SchedulerService_UpdateSchedule_Handler,
|
|
},
|
|
{
|
|
MethodName: "PatchSchedule",
|
|
Handler: _SchedulerService_PatchSchedule_Handler,
|
|
},
|
|
{
|
|
MethodName: "DeleteSchedule",
|
|
Handler: _SchedulerService_DeleteSchedule_Handler,
|
|
},
|
|
{
|
|
MethodName: "DescribeSchedule",
|
|
Handler: _SchedulerService_DescribeSchedule_Handler,
|
|
},
|
|
},
|
|
Streams: []grpc.StreamDesc{},
|
|
Metadata: "temporal/server/chasm/lib/scheduler/proto/v1/service.proto",
|
|
}
|