mirror of
https://github.com/hatchet-dev/hatchet.git
synced 2025-12-20 16:20:11 -06:00
- shell scripts logging and fail on error - use npx --yes instead of manual global install - run go libs directly instead of installing and running binaries - add missing brew dependencies
242 lines
8.2 KiB
Go
242 lines
8.2 KiB
Go
// Code generated by protoc-gen-go-grpc. DO NOT EDIT.
|
|
// versions:
|
|
// - protoc-gen-go-grpc v1.2.0
|
|
// - protoc v4.25.1
|
|
// source: dispatcher.proto
|
|
|
|
package contracts
|
|
|
|
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
|
|
|
|
// DispatcherClient is the client API for Dispatcher 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 DispatcherClient interface {
|
|
Register(ctx context.Context, in *WorkerRegisterRequest, opts ...grpc.CallOption) (*WorkerRegisterResponse, error)
|
|
Listen(ctx context.Context, in *WorkerListenRequest, opts ...grpc.CallOption) (Dispatcher_ListenClient, error)
|
|
SendActionEvent(ctx context.Context, in *ActionEvent, opts ...grpc.CallOption) (*ActionEventResponse, error)
|
|
Unsubscribe(ctx context.Context, in *WorkerUnsubscribeRequest, opts ...grpc.CallOption) (*WorkerUnsubscribeResponse, error)
|
|
}
|
|
|
|
type dispatcherClient struct {
|
|
cc grpc.ClientConnInterface
|
|
}
|
|
|
|
func NewDispatcherClient(cc grpc.ClientConnInterface) DispatcherClient {
|
|
return &dispatcherClient{cc}
|
|
}
|
|
|
|
func (c *dispatcherClient) Register(ctx context.Context, in *WorkerRegisterRequest, opts ...grpc.CallOption) (*WorkerRegisterResponse, error) {
|
|
out := new(WorkerRegisterResponse)
|
|
err := c.cc.Invoke(ctx, "/Dispatcher/Register", in, out, opts...)
|
|
if err != nil {
|
|
return nil, err
|
|
}
|
|
return out, nil
|
|
}
|
|
|
|
func (c *dispatcherClient) Listen(ctx context.Context, in *WorkerListenRequest, opts ...grpc.CallOption) (Dispatcher_ListenClient, error) {
|
|
stream, err := c.cc.NewStream(ctx, &Dispatcher_ServiceDesc.Streams[0], "/Dispatcher/Listen", opts...)
|
|
if err != nil {
|
|
return nil, err
|
|
}
|
|
x := &dispatcherListenClient{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 Dispatcher_ListenClient interface {
|
|
Recv() (*AssignedAction, error)
|
|
grpc.ClientStream
|
|
}
|
|
|
|
type dispatcherListenClient struct {
|
|
grpc.ClientStream
|
|
}
|
|
|
|
func (x *dispatcherListenClient) Recv() (*AssignedAction, error) {
|
|
m := new(AssignedAction)
|
|
if err := x.ClientStream.RecvMsg(m); err != nil {
|
|
return nil, err
|
|
}
|
|
return m, nil
|
|
}
|
|
|
|
func (c *dispatcherClient) SendActionEvent(ctx context.Context, in *ActionEvent, opts ...grpc.CallOption) (*ActionEventResponse, error) {
|
|
out := new(ActionEventResponse)
|
|
err := c.cc.Invoke(ctx, "/Dispatcher/SendActionEvent", in, out, opts...)
|
|
if err != nil {
|
|
return nil, err
|
|
}
|
|
return out, nil
|
|
}
|
|
|
|
func (c *dispatcherClient) Unsubscribe(ctx context.Context, in *WorkerUnsubscribeRequest, opts ...grpc.CallOption) (*WorkerUnsubscribeResponse, error) {
|
|
out := new(WorkerUnsubscribeResponse)
|
|
err := c.cc.Invoke(ctx, "/Dispatcher/Unsubscribe", in, out, opts...)
|
|
if err != nil {
|
|
return nil, err
|
|
}
|
|
return out, nil
|
|
}
|
|
|
|
// DispatcherServer is the server API for Dispatcher service.
|
|
// All implementations must embed UnimplementedDispatcherServer
|
|
// for forward compatibility
|
|
type DispatcherServer interface {
|
|
Register(context.Context, *WorkerRegisterRequest) (*WorkerRegisterResponse, error)
|
|
Listen(*WorkerListenRequest, Dispatcher_ListenServer) error
|
|
SendActionEvent(context.Context, *ActionEvent) (*ActionEventResponse, error)
|
|
Unsubscribe(context.Context, *WorkerUnsubscribeRequest) (*WorkerUnsubscribeResponse, error)
|
|
mustEmbedUnimplementedDispatcherServer()
|
|
}
|
|
|
|
// UnimplementedDispatcherServer must be embedded to have forward compatible implementations.
|
|
type UnimplementedDispatcherServer struct {
|
|
}
|
|
|
|
func (UnimplementedDispatcherServer) Register(context.Context, *WorkerRegisterRequest) (*WorkerRegisterResponse, error) {
|
|
return nil, status.Errorf(codes.Unimplemented, "method Register not implemented")
|
|
}
|
|
func (UnimplementedDispatcherServer) Listen(*WorkerListenRequest, Dispatcher_ListenServer) error {
|
|
return status.Errorf(codes.Unimplemented, "method Listen not implemented")
|
|
}
|
|
func (UnimplementedDispatcherServer) SendActionEvent(context.Context, *ActionEvent) (*ActionEventResponse, error) {
|
|
return nil, status.Errorf(codes.Unimplemented, "method SendActionEvent not implemented")
|
|
}
|
|
func (UnimplementedDispatcherServer) Unsubscribe(context.Context, *WorkerUnsubscribeRequest) (*WorkerUnsubscribeResponse, error) {
|
|
return nil, status.Errorf(codes.Unimplemented, "method Unsubscribe not implemented")
|
|
}
|
|
func (UnimplementedDispatcherServer) mustEmbedUnimplementedDispatcherServer() {}
|
|
|
|
// UnsafeDispatcherServer may be embedded to opt out of forward compatibility for this service.
|
|
// Use of this interface is not recommended, as added methods to DispatcherServer will
|
|
// result in compilation errors.
|
|
type UnsafeDispatcherServer interface {
|
|
mustEmbedUnimplementedDispatcherServer()
|
|
}
|
|
|
|
func RegisterDispatcherServer(s grpc.ServiceRegistrar, srv DispatcherServer) {
|
|
s.RegisterService(&Dispatcher_ServiceDesc, srv)
|
|
}
|
|
|
|
func _Dispatcher_Register_Handler(srv interface{}, ctx context.Context, dec func(interface{}) error, interceptor grpc.UnaryServerInterceptor) (interface{}, error) {
|
|
in := new(WorkerRegisterRequest)
|
|
if err := dec(in); err != nil {
|
|
return nil, err
|
|
}
|
|
if interceptor == nil {
|
|
return srv.(DispatcherServer).Register(ctx, in)
|
|
}
|
|
info := &grpc.UnaryServerInfo{
|
|
Server: srv,
|
|
FullMethod: "/Dispatcher/Register",
|
|
}
|
|
handler := func(ctx context.Context, req interface{}) (interface{}, error) {
|
|
return srv.(DispatcherServer).Register(ctx, req.(*WorkerRegisterRequest))
|
|
}
|
|
return interceptor(ctx, in, info, handler)
|
|
}
|
|
|
|
func _Dispatcher_Listen_Handler(srv interface{}, stream grpc.ServerStream) error {
|
|
m := new(WorkerListenRequest)
|
|
if err := stream.RecvMsg(m); err != nil {
|
|
return err
|
|
}
|
|
return srv.(DispatcherServer).Listen(m, &dispatcherListenServer{stream})
|
|
}
|
|
|
|
type Dispatcher_ListenServer interface {
|
|
Send(*AssignedAction) error
|
|
grpc.ServerStream
|
|
}
|
|
|
|
type dispatcherListenServer struct {
|
|
grpc.ServerStream
|
|
}
|
|
|
|
func (x *dispatcherListenServer) Send(m *AssignedAction) error {
|
|
return x.ServerStream.SendMsg(m)
|
|
}
|
|
|
|
func _Dispatcher_SendActionEvent_Handler(srv interface{}, ctx context.Context, dec func(interface{}) error, interceptor grpc.UnaryServerInterceptor) (interface{}, error) {
|
|
in := new(ActionEvent)
|
|
if err := dec(in); err != nil {
|
|
return nil, err
|
|
}
|
|
if interceptor == nil {
|
|
return srv.(DispatcherServer).SendActionEvent(ctx, in)
|
|
}
|
|
info := &grpc.UnaryServerInfo{
|
|
Server: srv,
|
|
FullMethod: "/Dispatcher/SendActionEvent",
|
|
}
|
|
handler := func(ctx context.Context, req interface{}) (interface{}, error) {
|
|
return srv.(DispatcherServer).SendActionEvent(ctx, req.(*ActionEvent))
|
|
}
|
|
return interceptor(ctx, in, info, handler)
|
|
}
|
|
|
|
func _Dispatcher_Unsubscribe_Handler(srv interface{}, ctx context.Context, dec func(interface{}) error, interceptor grpc.UnaryServerInterceptor) (interface{}, error) {
|
|
in := new(WorkerUnsubscribeRequest)
|
|
if err := dec(in); err != nil {
|
|
return nil, err
|
|
}
|
|
if interceptor == nil {
|
|
return srv.(DispatcherServer).Unsubscribe(ctx, in)
|
|
}
|
|
info := &grpc.UnaryServerInfo{
|
|
Server: srv,
|
|
FullMethod: "/Dispatcher/Unsubscribe",
|
|
}
|
|
handler := func(ctx context.Context, req interface{}) (interface{}, error) {
|
|
return srv.(DispatcherServer).Unsubscribe(ctx, req.(*WorkerUnsubscribeRequest))
|
|
}
|
|
return interceptor(ctx, in, info, handler)
|
|
}
|
|
|
|
// Dispatcher_ServiceDesc is the grpc.ServiceDesc for Dispatcher service.
|
|
// It's only intended for direct use with grpc.RegisterService,
|
|
// and not to be introspected or modified (even as a copy)
|
|
var Dispatcher_ServiceDesc = grpc.ServiceDesc{
|
|
ServiceName: "Dispatcher",
|
|
HandlerType: (*DispatcherServer)(nil),
|
|
Methods: []grpc.MethodDesc{
|
|
{
|
|
MethodName: "Register",
|
|
Handler: _Dispatcher_Register_Handler,
|
|
},
|
|
{
|
|
MethodName: "SendActionEvent",
|
|
Handler: _Dispatcher_SendActionEvent_Handler,
|
|
},
|
|
{
|
|
MethodName: "Unsubscribe",
|
|
Handler: _Dispatcher_Unsubscribe_Handler,
|
|
},
|
|
},
|
|
Streams: []grpc.StreamDesc{
|
|
{
|
|
StreamName: "Listen",
|
|
Handler: _Dispatcher_Listen_Handler,
|
|
ServerStreams: true,
|
|
},
|
|
},
|
|
Metadata: "dispatcher.proto",
|
|
}
|