github.com/bhojpur/cache@v0.0.4/pkg/api/v1/cache_grpc.pb.go (about)

     1  // Code generated by protoc-gen-go-grpc. DO NOT EDIT.
     2  
     3  package v1
     4  
     5  import (
     6  	context "context"
     7  	grpc "google.golang.org/grpc"
     8  	codes "google.golang.org/grpc/codes"
     9  	status "google.golang.org/grpc/status"
    10  )
    11  
    12  // This is a compile-time assertion to ensure that this generated file
    13  // is compatible with the grpc package it is being compiled against.
    14  // Requires gRPC-Go v1.32.0 or later.
    15  const _ = grpc.SupportPackageIsVersion7
    16  
    17  // CacheServiceClient is the client API for CacheService service.
    18  //
    19  // 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.
    20  type CacheServiceClient interface {
    21  	// StartLocalEngine starts a Cache Engine on the Bhojpur.NET Platform directly.
    22  	// The incoming requests are expected in the following order:
    23  	//   1. metadata
    24  	//   2. all bytes constituting the cache/config.yaml
    25  	//   3. all bytes constituting the Engine YAML that will be executed (that the config.yaml points to)
    26  	//   4. all bytes constituting the gzipped Bhojpur.NET Platform application tar stream
    27  	//   5. the Bhojpur.NET Platform application tar stream done marker
    28  	StartLocalEngine(ctx context.Context, opts ...grpc.CallOption) (CacheService_StartLocalEngineClient, error)
    29  	// StartFromPreviousEngine starts a new Engine based on a previous one.
    30  	// If the previous Engine does not have the can-replay condition set this call will result in an error.
    31  	StartFromPreviousEngine(ctx context.Context, in *StartFromPreviousEngineRequest, opts ...grpc.CallOption) (*StartEngineResponse, error)
    32  	// StartEngineRequest starts a new Engine based on its specification.
    33  	StartEngine(ctx context.Context, in *StartEngineRequest, opts ...grpc.CallOption) (*StartEngineResponse, error)
    34  	// Searches for Engine(s) known to this Engine
    35  	ListEngines(ctx context.Context, in *ListEnginesRequest, opts ...grpc.CallOption) (*ListEnginesResponse, error)
    36  	// Subscribe listens to new Engine(s) updates
    37  	Subscribe(ctx context.Context, in *SubscribeRequest, opts ...grpc.CallOption) (CacheService_SubscribeClient, error)
    38  	// GetEngine retrieves details of a single Engine
    39  	GetEngine(ctx context.Context, in *GetEngineRequest, opts ...grpc.CallOption) (*GetEngineResponse, error)
    40  	// Listen listens to Engine updates and log output of a running Engine
    41  	Listen(ctx context.Context, in *ListenRequest, opts ...grpc.CallOption) (CacheService_ListenClient, error)
    42  	// StopEngine stops a currently running Engine
    43  	StopEngine(ctx context.Context, in *StopEngineRequest, opts ...grpc.CallOption) (*StopEngineResponse, error)
    44  }
    45  
    46  type cacheServiceClient struct {
    47  	cc grpc.ClientConnInterface
    48  }
    49  
    50  func NewCacheServiceClient(cc grpc.ClientConnInterface) CacheServiceClient {
    51  	return &cacheServiceClient{cc}
    52  }
    53  
    54  func (c *cacheServiceClient) StartLocalEngine(ctx context.Context, opts ...grpc.CallOption) (CacheService_StartLocalEngineClient, error) {
    55  	stream, err := c.cc.NewStream(ctx, &CacheService_ServiceDesc.Streams[0], "/v1.CacheService/StartLocalEngine", opts...)
    56  	if err != nil {
    57  		return nil, err
    58  	}
    59  	x := &cacheServiceStartLocalEngineClient{stream}
    60  	return x, nil
    61  }
    62  
    63  type CacheService_StartLocalEngineClient interface {
    64  	Send(*StartLocalEngineRequest) error
    65  	CloseAndRecv() (*StartEngineResponse, error)
    66  	grpc.ClientStream
    67  }
    68  
    69  type cacheServiceStartLocalEngineClient struct {
    70  	grpc.ClientStream
    71  }
    72  
    73  func (x *cacheServiceStartLocalEngineClient) Send(m *StartLocalEngineRequest) error {
    74  	return x.ClientStream.SendMsg(m)
    75  }
    76  
    77  func (x *cacheServiceStartLocalEngineClient) CloseAndRecv() (*StartEngineResponse, error) {
    78  	if err := x.ClientStream.CloseSend(); err != nil {
    79  		return nil, err
    80  	}
    81  	m := new(StartEngineResponse)
    82  	if err := x.ClientStream.RecvMsg(m); err != nil {
    83  		return nil, err
    84  	}
    85  	return m, nil
    86  }
    87  
    88  func (c *cacheServiceClient) StartFromPreviousEngine(ctx context.Context, in *StartFromPreviousEngineRequest, opts ...grpc.CallOption) (*StartEngineResponse, error) {
    89  	out := new(StartEngineResponse)
    90  	err := c.cc.Invoke(ctx, "/v1.CacheService/StartFromPreviousEngine", in, out, opts...)
    91  	if err != nil {
    92  		return nil, err
    93  	}
    94  	return out, nil
    95  }
    96  
    97  func (c *cacheServiceClient) StartEngine(ctx context.Context, in *StartEngineRequest, opts ...grpc.CallOption) (*StartEngineResponse, error) {
    98  	out := new(StartEngineResponse)
    99  	err := c.cc.Invoke(ctx, "/v1.CacheService/StartEngine", in, out, opts...)
   100  	if err != nil {
   101  		return nil, err
   102  	}
   103  	return out, nil
   104  }
   105  
   106  func (c *cacheServiceClient) ListEngines(ctx context.Context, in *ListEnginesRequest, opts ...grpc.CallOption) (*ListEnginesResponse, error) {
   107  	out := new(ListEnginesResponse)
   108  	err := c.cc.Invoke(ctx, "/v1.CacheService/ListEngines", in, out, opts...)
   109  	if err != nil {
   110  		return nil, err
   111  	}
   112  	return out, nil
   113  }
   114  
   115  func (c *cacheServiceClient) Subscribe(ctx context.Context, in *SubscribeRequest, opts ...grpc.CallOption) (CacheService_SubscribeClient, error) {
   116  	stream, err := c.cc.NewStream(ctx, &CacheService_ServiceDesc.Streams[1], "/v1.CacheService/Subscribe", opts...)
   117  	if err != nil {
   118  		return nil, err
   119  	}
   120  	x := &cacheServiceSubscribeClient{stream}
   121  	if err := x.ClientStream.SendMsg(in); err != nil {
   122  		return nil, err
   123  	}
   124  	if err := x.ClientStream.CloseSend(); err != nil {
   125  		return nil, err
   126  	}
   127  	return x, nil
   128  }
   129  
   130  type CacheService_SubscribeClient interface {
   131  	Recv() (*SubscribeResponse, error)
   132  	grpc.ClientStream
   133  }
   134  
   135  type cacheServiceSubscribeClient struct {
   136  	grpc.ClientStream
   137  }
   138  
   139  func (x *cacheServiceSubscribeClient) Recv() (*SubscribeResponse, error) {
   140  	m := new(SubscribeResponse)
   141  	if err := x.ClientStream.RecvMsg(m); err != nil {
   142  		return nil, err
   143  	}
   144  	return m, nil
   145  }
   146  
   147  func (c *cacheServiceClient) GetEngine(ctx context.Context, in *GetEngineRequest, opts ...grpc.CallOption) (*GetEngineResponse, error) {
   148  	out := new(GetEngineResponse)
   149  	err := c.cc.Invoke(ctx, "/v1.CacheService/GetEngine", in, out, opts...)
   150  	if err != nil {
   151  		return nil, err
   152  	}
   153  	return out, nil
   154  }
   155  
   156  func (c *cacheServiceClient) Listen(ctx context.Context, in *ListenRequest, opts ...grpc.CallOption) (CacheService_ListenClient, error) {
   157  	stream, err := c.cc.NewStream(ctx, &CacheService_ServiceDesc.Streams[2], "/v1.CacheService/Listen", opts...)
   158  	if err != nil {
   159  		return nil, err
   160  	}
   161  	x := &cacheServiceListenClient{stream}
   162  	if err := x.ClientStream.SendMsg(in); err != nil {
   163  		return nil, err
   164  	}
   165  	if err := x.ClientStream.CloseSend(); err != nil {
   166  		return nil, err
   167  	}
   168  	return x, nil
   169  }
   170  
   171  type CacheService_ListenClient interface {
   172  	Recv() (*ListenResponse, error)
   173  	grpc.ClientStream
   174  }
   175  
   176  type cacheServiceListenClient struct {
   177  	grpc.ClientStream
   178  }
   179  
   180  func (x *cacheServiceListenClient) Recv() (*ListenResponse, error) {
   181  	m := new(ListenResponse)
   182  	if err := x.ClientStream.RecvMsg(m); err != nil {
   183  		return nil, err
   184  	}
   185  	return m, nil
   186  }
   187  
   188  func (c *cacheServiceClient) StopEngine(ctx context.Context, in *StopEngineRequest, opts ...grpc.CallOption) (*StopEngineResponse, error) {
   189  	out := new(StopEngineResponse)
   190  	err := c.cc.Invoke(ctx, "/v1.CacheService/StopEngine", in, out, opts...)
   191  	if err != nil {
   192  		return nil, err
   193  	}
   194  	return out, nil
   195  }
   196  
   197  // CacheServiceServer is the server API for CacheService service.
   198  // All implementations must embed UnimplementedCacheServiceServer
   199  // for forward compatibility
   200  type CacheServiceServer interface {
   201  	// StartLocalEngine starts a Cache Engine on the Bhojpur.NET Platform directly.
   202  	// The incoming requests are expected in the following order:
   203  	//   1. metadata
   204  	//   2. all bytes constituting the cache/config.yaml
   205  	//   3. all bytes constituting the Engine YAML that will be executed (that the config.yaml points to)
   206  	//   4. all bytes constituting the gzipped Bhojpur.NET Platform application tar stream
   207  	//   5. the Bhojpur.NET Platform application tar stream done marker
   208  	StartLocalEngine(CacheService_StartLocalEngineServer) error
   209  	// StartFromPreviousEngine starts a new Engine based on a previous one.
   210  	// If the previous Engine does not have the can-replay condition set this call will result in an error.
   211  	StartFromPreviousEngine(context.Context, *StartFromPreviousEngineRequest) (*StartEngineResponse, error)
   212  	// StartEngineRequest starts a new Engine based on its specification.
   213  	StartEngine(context.Context, *StartEngineRequest) (*StartEngineResponse, error)
   214  	// Searches for Engine(s) known to this Engine
   215  	ListEngines(context.Context, *ListEnginesRequest) (*ListEnginesResponse, error)
   216  	// Subscribe listens to new Engine(s) updates
   217  	Subscribe(*SubscribeRequest, CacheService_SubscribeServer) error
   218  	// GetEngine retrieves details of a single Engine
   219  	GetEngine(context.Context, *GetEngineRequest) (*GetEngineResponse, error)
   220  	// Listen listens to Engine updates and log output of a running Engine
   221  	Listen(*ListenRequest, CacheService_ListenServer) error
   222  	// StopEngine stops a currently running Engine
   223  	StopEngine(context.Context, *StopEngineRequest) (*StopEngineResponse, error)
   224  	mustEmbedUnimplementedCacheServiceServer()
   225  }
   226  
   227  // UnimplementedCacheServiceServer must be embedded to have forward compatible implementations.
   228  type UnimplementedCacheServiceServer struct {
   229  }
   230  
   231  func (UnimplementedCacheServiceServer) StartLocalEngine(CacheService_StartLocalEngineServer) error {
   232  	return status.Errorf(codes.Unimplemented, "method StartLocalEngine not implemented")
   233  }
   234  func (UnimplementedCacheServiceServer) StartFromPreviousEngine(context.Context, *StartFromPreviousEngineRequest) (*StartEngineResponse, error) {
   235  	return nil, status.Errorf(codes.Unimplemented, "method StartFromPreviousEngine not implemented")
   236  }
   237  func (UnimplementedCacheServiceServer) StartEngine(context.Context, *StartEngineRequest) (*StartEngineResponse, error) {
   238  	return nil, status.Errorf(codes.Unimplemented, "method StartEngine not implemented")
   239  }
   240  func (UnimplementedCacheServiceServer) ListEngines(context.Context, *ListEnginesRequest) (*ListEnginesResponse, error) {
   241  	return nil, status.Errorf(codes.Unimplemented, "method ListEngines not implemented")
   242  }
   243  func (UnimplementedCacheServiceServer) Subscribe(*SubscribeRequest, CacheService_SubscribeServer) error {
   244  	return status.Errorf(codes.Unimplemented, "method Subscribe not implemented")
   245  }
   246  func (UnimplementedCacheServiceServer) GetEngine(context.Context, *GetEngineRequest) (*GetEngineResponse, error) {
   247  	return nil, status.Errorf(codes.Unimplemented, "method GetEngine not implemented")
   248  }
   249  func (UnimplementedCacheServiceServer) Listen(*ListenRequest, CacheService_ListenServer) error {
   250  	return status.Errorf(codes.Unimplemented, "method Listen not implemented")
   251  }
   252  func (UnimplementedCacheServiceServer) StopEngine(context.Context, *StopEngineRequest) (*StopEngineResponse, error) {
   253  	return nil, status.Errorf(codes.Unimplemented, "method StopEngine not implemented")
   254  }
   255  func (UnimplementedCacheServiceServer) mustEmbedUnimplementedCacheServiceServer() {}
   256  
   257  // UnsafeCacheServiceServer may be embedded to opt out of forward compatibility for this service.
   258  // Use of this interface is not recommended, as added methods to CacheServiceServer will
   259  // result in compilation errors.
   260  type UnsafeCacheServiceServer interface {
   261  	mustEmbedUnimplementedCacheServiceServer()
   262  }
   263  
   264  func RegisterCacheServiceServer(s grpc.ServiceRegistrar, srv CacheServiceServer) {
   265  	s.RegisterService(&CacheService_ServiceDesc, srv)
   266  }
   267  
   268  func _CacheService_StartLocalEngine_Handler(srv interface{}, stream grpc.ServerStream) error {
   269  	return srv.(CacheServiceServer).StartLocalEngine(&cacheServiceStartLocalEngineServer{stream})
   270  }
   271  
   272  type CacheService_StartLocalEngineServer interface {
   273  	SendAndClose(*StartEngineResponse) error
   274  	Recv() (*StartLocalEngineRequest, error)
   275  	grpc.ServerStream
   276  }
   277  
   278  type cacheServiceStartLocalEngineServer struct {
   279  	grpc.ServerStream
   280  }
   281  
   282  func (x *cacheServiceStartLocalEngineServer) SendAndClose(m *StartEngineResponse) error {
   283  	return x.ServerStream.SendMsg(m)
   284  }
   285  
   286  func (x *cacheServiceStartLocalEngineServer) Recv() (*StartLocalEngineRequest, error) {
   287  	m := new(StartLocalEngineRequest)
   288  	if err := x.ServerStream.RecvMsg(m); err != nil {
   289  		return nil, err
   290  	}
   291  	return m, nil
   292  }
   293  
   294  func _CacheService_StartFromPreviousEngine_Handler(srv interface{}, ctx context.Context, dec func(interface{}) error, interceptor grpc.UnaryServerInterceptor) (interface{}, error) {
   295  	in := new(StartFromPreviousEngineRequest)
   296  	if err := dec(in); err != nil {
   297  		return nil, err
   298  	}
   299  	if interceptor == nil {
   300  		return srv.(CacheServiceServer).StartFromPreviousEngine(ctx, in)
   301  	}
   302  	info := &grpc.UnaryServerInfo{
   303  		Server:     srv,
   304  		FullMethod: "/v1.CacheService/StartFromPreviousEngine",
   305  	}
   306  	handler := func(ctx context.Context, req interface{}) (interface{}, error) {
   307  		return srv.(CacheServiceServer).StartFromPreviousEngine(ctx, req.(*StartFromPreviousEngineRequest))
   308  	}
   309  	return interceptor(ctx, in, info, handler)
   310  }
   311  
   312  func _CacheService_StartEngine_Handler(srv interface{}, ctx context.Context, dec func(interface{}) error, interceptor grpc.UnaryServerInterceptor) (interface{}, error) {
   313  	in := new(StartEngineRequest)
   314  	if err := dec(in); err != nil {
   315  		return nil, err
   316  	}
   317  	if interceptor == nil {
   318  		return srv.(CacheServiceServer).StartEngine(ctx, in)
   319  	}
   320  	info := &grpc.UnaryServerInfo{
   321  		Server:     srv,
   322  		FullMethod: "/v1.CacheService/StartEngine",
   323  	}
   324  	handler := func(ctx context.Context, req interface{}) (interface{}, error) {
   325  		return srv.(CacheServiceServer).StartEngine(ctx, req.(*StartEngineRequest))
   326  	}
   327  	return interceptor(ctx, in, info, handler)
   328  }
   329  
   330  func _CacheService_ListEngines_Handler(srv interface{}, ctx context.Context, dec func(interface{}) error, interceptor grpc.UnaryServerInterceptor) (interface{}, error) {
   331  	in := new(ListEnginesRequest)
   332  	if err := dec(in); err != nil {
   333  		return nil, err
   334  	}
   335  	if interceptor == nil {
   336  		return srv.(CacheServiceServer).ListEngines(ctx, in)
   337  	}
   338  	info := &grpc.UnaryServerInfo{
   339  		Server:     srv,
   340  		FullMethod: "/v1.CacheService/ListEngines",
   341  	}
   342  	handler := func(ctx context.Context, req interface{}) (interface{}, error) {
   343  		return srv.(CacheServiceServer).ListEngines(ctx, req.(*ListEnginesRequest))
   344  	}
   345  	return interceptor(ctx, in, info, handler)
   346  }
   347  
   348  func _CacheService_Subscribe_Handler(srv interface{}, stream grpc.ServerStream) error {
   349  	m := new(SubscribeRequest)
   350  	if err := stream.RecvMsg(m); err != nil {
   351  		return err
   352  	}
   353  	return srv.(CacheServiceServer).Subscribe(m, &cacheServiceSubscribeServer{stream})
   354  }
   355  
   356  type CacheService_SubscribeServer interface {
   357  	Send(*SubscribeResponse) error
   358  	grpc.ServerStream
   359  }
   360  
   361  type cacheServiceSubscribeServer struct {
   362  	grpc.ServerStream
   363  }
   364  
   365  func (x *cacheServiceSubscribeServer) Send(m *SubscribeResponse) error {
   366  	return x.ServerStream.SendMsg(m)
   367  }
   368  
   369  func _CacheService_GetEngine_Handler(srv interface{}, ctx context.Context, dec func(interface{}) error, interceptor grpc.UnaryServerInterceptor) (interface{}, error) {
   370  	in := new(GetEngineRequest)
   371  	if err := dec(in); err != nil {
   372  		return nil, err
   373  	}
   374  	if interceptor == nil {
   375  		return srv.(CacheServiceServer).GetEngine(ctx, in)
   376  	}
   377  	info := &grpc.UnaryServerInfo{
   378  		Server:     srv,
   379  		FullMethod: "/v1.CacheService/GetEngine",
   380  	}
   381  	handler := func(ctx context.Context, req interface{}) (interface{}, error) {
   382  		return srv.(CacheServiceServer).GetEngine(ctx, req.(*GetEngineRequest))
   383  	}
   384  	return interceptor(ctx, in, info, handler)
   385  }
   386  
   387  func _CacheService_Listen_Handler(srv interface{}, stream grpc.ServerStream) error {
   388  	m := new(ListenRequest)
   389  	if err := stream.RecvMsg(m); err != nil {
   390  		return err
   391  	}
   392  	return srv.(CacheServiceServer).Listen(m, &cacheServiceListenServer{stream})
   393  }
   394  
   395  type CacheService_ListenServer interface {
   396  	Send(*ListenResponse) error
   397  	grpc.ServerStream
   398  }
   399  
   400  type cacheServiceListenServer struct {
   401  	grpc.ServerStream
   402  }
   403  
   404  func (x *cacheServiceListenServer) Send(m *ListenResponse) error {
   405  	return x.ServerStream.SendMsg(m)
   406  }
   407  
   408  func _CacheService_StopEngine_Handler(srv interface{}, ctx context.Context, dec func(interface{}) error, interceptor grpc.UnaryServerInterceptor) (interface{}, error) {
   409  	in := new(StopEngineRequest)
   410  	if err := dec(in); err != nil {
   411  		return nil, err
   412  	}
   413  	if interceptor == nil {
   414  		return srv.(CacheServiceServer).StopEngine(ctx, in)
   415  	}
   416  	info := &grpc.UnaryServerInfo{
   417  		Server:     srv,
   418  		FullMethod: "/v1.CacheService/StopEngine",
   419  	}
   420  	handler := func(ctx context.Context, req interface{}) (interface{}, error) {
   421  		return srv.(CacheServiceServer).StopEngine(ctx, req.(*StopEngineRequest))
   422  	}
   423  	return interceptor(ctx, in, info, handler)
   424  }
   425  
   426  // CacheService_ServiceDesc is the grpc.ServiceDesc for CacheService service.
   427  // It's only intended for direct use with grpc.RegisterService,
   428  // and not to be introspected or modified (even as a copy)
   429  var CacheService_ServiceDesc = grpc.ServiceDesc{
   430  	ServiceName: "v1.CacheService",
   431  	HandlerType: (*CacheServiceServer)(nil),
   432  	Methods: []grpc.MethodDesc{
   433  		{
   434  			MethodName: "StartFromPreviousEngine",
   435  			Handler:    _CacheService_StartFromPreviousEngine_Handler,
   436  		},
   437  		{
   438  			MethodName: "StartEngine",
   439  			Handler:    _CacheService_StartEngine_Handler,
   440  		},
   441  		{
   442  			MethodName: "ListEngines",
   443  			Handler:    _CacheService_ListEngines_Handler,
   444  		},
   445  		{
   446  			MethodName: "GetEngine",
   447  			Handler:    _CacheService_GetEngine_Handler,
   448  		},
   449  		{
   450  			MethodName: "StopEngine",
   451  			Handler:    _CacheService_StopEngine_Handler,
   452  		},
   453  	},
   454  	Streams: []grpc.StreamDesc{
   455  		{
   456  			StreamName:    "StartLocalEngine",
   457  			Handler:       _CacheService_StartLocalEngine_Handler,
   458  			ClientStreams: true,
   459  		},
   460  		{
   461  			StreamName:    "Subscribe",
   462  			Handler:       _CacheService_Subscribe_Handler,
   463  			ServerStreams: true,
   464  		},
   465  		{
   466  			StreamName:    "Listen",
   467  			Handler:       _CacheService_Listen_Handler,
   468  			ServerStreams: true,
   469  		},
   470  	},
   471  	Metadata: "cache.proto",
   472  }