github.com/bhojpur/cache@v0.0.4/pkg/api/v1/cache-ui_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 // CacheUIClient is the client API for CacheUI 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 CacheUIClient interface { 21 // ListEngineSpecs returns a list of Cache Engine(s) that can be started through the UI. 22 ListEngineSpecs(ctx context.Context, in *ListEngineSpecsRequest, opts ...grpc.CallOption) (CacheUI_ListEngineSpecsClient, error) 23 // IsReadOnly returns true if the UI is readonly. 24 IsReadOnly(ctx context.Context, in *IsReadOnlyRequest, opts ...grpc.CallOption) (*IsReadOnlyResponse, error) 25 } 26 27 type cacheUIClient struct { 28 cc grpc.ClientConnInterface 29 } 30 31 func NewCacheUIClient(cc grpc.ClientConnInterface) CacheUIClient { 32 return &cacheUIClient{cc} 33 } 34 35 func (c *cacheUIClient) ListEngineSpecs(ctx context.Context, in *ListEngineSpecsRequest, opts ...grpc.CallOption) (CacheUI_ListEngineSpecsClient, error) { 36 stream, err := c.cc.NewStream(ctx, &CacheUI_ServiceDesc.Streams[0], "/v1.CacheUI/ListEngineSpecs", opts...) 37 if err != nil { 38 return nil, err 39 } 40 x := &cacheUIListEngineSpecsClient{stream} 41 if err := x.ClientStream.SendMsg(in); err != nil { 42 return nil, err 43 } 44 if err := x.ClientStream.CloseSend(); err != nil { 45 return nil, err 46 } 47 return x, nil 48 } 49 50 type CacheUI_ListEngineSpecsClient interface { 51 Recv() (*ListEngineSpecsResponse, error) 52 grpc.ClientStream 53 } 54 55 type cacheUIListEngineSpecsClient struct { 56 grpc.ClientStream 57 } 58 59 func (x *cacheUIListEngineSpecsClient) Recv() (*ListEngineSpecsResponse, error) { 60 m := new(ListEngineSpecsResponse) 61 if err := x.ClientStream.RecvMsg(m); err != nil { 62 return nil, err 63 } 64 return m, nil 65 } 66 67 func (c *cacheUIClient) IsReadOnly(ctx context.Context, in *IsReadOnlyRequest, opts ...grpc.CallOption) (*IsReadOnlyResponse, error) { 68 out := new(IsReadOnlyResponse) 69 err := c.cc.Invoke(ctx, "/v1.CacheUI/IsReadOnly", in, out, opts...) 70 if err != nil { 71 return nil, err 72 } 73 return out, nil 74 } 75 76 // CacheUIServer is the server API for CacheUI service. 77 // All implementations must embed UnimplementedCacheUIServer 78 // for forward compatibility 79 type CacheUIServer interface { 80 // ListEngineSpecs returns a list of Cache Engine(s) that can be started through the UI. 81 ListEngineSpecs(*ListEngineSpecsRequest, CacheUI_ListEngineSpecsServer) error 82 // IsReadOnly returns true if the UI is readonly. 83 IsReadOnly(context.Context, *IsReadOnlyRequest) (*IsReadOnlyResponse, error) 84 mustEmbedUnimplementedCacheUIServer() 85 } 86 87 // UnimplementedCacheUIServer must be embedded to have forward compatible implementations. 88 type UnimplementedCacheUIServer struct { 89 } 90 91 func (UnimplementedCacheUIServer) ListEngineSpecs(*ListEngineSpecsRequest, CacheUI_ListEngineSpecsServer) error { 92 return status.Errorf(codes.Unimplemented, "method ListEngineSpecs not implemented") 93 } 94 func (UnimplementedCacheUIServer) IsReadOnly(context.Context, *IsReadOnlyRequest) (*IsReadOnlyResponse, error) { 95 return nil, status.Errorf(codes.Unimplemented, "method IsReadOnly not implemented") 96 } 97 func (UnimplementedCacheUIServer) mustEmbedUnimplementedCacheUIServer() {} 98 99 // UnsafeCacheUIServer may be embedded to opt out of forward compatibility for this service. 100 // Use of this interface is not recommended, as added methods to CacheUIServer will 101 // result in compilation errors. 102 type UnsafeCacheUIServer interface { 103 mustEmbedUnimplementedCacheUIServer() 104 } 105 106 func RegisterCacheUIServer(s grpc.ServiceRegistrar, srv CacheUIServer) { 107 s.RegisterService(&CacheUI_ServiceDesc, srv) 108 } 109 110 func _CacheUI_ListEngineSpecs_Handler(srv interface{}, stream grpc.ServerStream) error { 111 m := new(ListEngineSpecsRequest) 112 if err := stream.RecvMsg(m); err != nil { 113 return err 114 } 115 return srv.(CacheUIServer).ListEngineSpecs(m, &cacheUIListEngineSpecsServer{stream}) 116 } 117 118 type CacheUI_ListEngineSpecsServer interface { 119 Send(*ListEngineSpecsResponse) error 120 grpc.ServerStream 121 } 122 123 type cacheUIListEngineSpecsServer struct { 124 grpc.ServerStream 125 } 126 127 func (x *cacheUIListEngineSpecsServer) Send(m *ListEngineSpecsResponse) error { 128 return x.ServerStream.SendMsg(m) 129 } 130 131 func _CacheUI_IsReadOnly_Handler(srv interface{}, ctx context.Context, dec func(interface{}) error, interceptor grpc.UnaryServerInterceptor) (interface{}, error) { 132 in := new(IsReadOnlyRequest) 133 if err := dec(in); err != nil { 134 return nil, err 135 } 136 if interceptor == nil { 137 return srv.(CacheUIServer).IsReadOnly(ctx, in) 138 } 139 info := &grpc.UnaryServerInfo{ 140 Server: srv, 141 FullMethod: "/v1.CacheUI/IsReadOnly", 142 } 143 handler := func(ctx context.Context, req interface{}) (interface{}, error) { 144 return srv.(CacheUIServer).IsReadOnly(ctx, req.(*IsReadOnlyRequest)) 145 } 146 return interceptor(ctx, in, info, handler) 147 } 148 149 // CacheUI_ServiceDesc is the grpc.ServiceDesc for CacheUI service. 150 // It's only intended for direct use with grpc.RegisterService, 151 // and not to be introspected or modified (even as a copy) 152 var CacheUI_ServiceDesc = grpc.ServiceDesc{ 153 ServiceName: "v1.CacheUI", 154 HandlerType: (*CacheUIServer)(nil), 155 Methods: []grpc.MethodDesc{ 156 { 157 MethodName: "IsReadOnly", 158 Handler: _CacheUI_IsReadOnly_Handler, 159 }, 160 }, 161 Streams: []grpc.StreamDesc{ 162 { 163 StreamName: "ListEngineSpecs", 164 Handler: _CacheUI_ListEngineSpecs_Handler, 165 ServerStreams: true, 166 }, 167 }, 168 Metadata: "cache-ui.proto", 169 }