plugin_grpc.pb.go 13 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306
  1. // Code generated by protoc-gen-go-grpc. DO NOT EDIT.
  2. // versions:
  3. // - protoc-gen-go-grpc v1.6.2
  4. // - protoc v3.12.4
  5. // source: plugin.proto
  6. package pluginv1
  7. import (
  8. context "context"
  9. grpc "google.golang.org/grpc"
  10. codes "google.golang.org/grpc/codes"
  11. status "google.golang.org/grpc/status"
  12. )
  13. // This is a compile-time assertion to ensure that this generated file
  14. // is compatible with the grpc package it is being compiled against.
  15. // Requires gRPC-Go v1.64.0 or later.
  16. const _ = grpc.SupportPackageIsVersion9
  17. const (
  18. TransportPlugin_GetInfo_FullMethodName = "/sub2api.plugin.v1.TransportPlugin/GetInfo"
  19. TransportPlugin_Health_FullMethodName = "/sub2api.plugin.v1.TransportPlugin/Health"
  20. TransportPlugin_ValidateConfig_FullMethodName = "/sub2api.plugin.v1.TransportPlugin/ValidateConfig"
  21. TransportPlugin_ApplyConfig_FullMethodName = "/sub2api.plugin.v1.TransportPlugin/ApplyConfig"
  22. TransportPlugin_TestConfig_FullMethodName = "/sub2api.plugin.v1.TransportPlugin/TestConfig"
  23. TransportPlugin_Forward_FullMethodName = "/sub2api.plugin.v1.TransportPlugin/Forward"
  24. )
  25. // TransportPluginClient is the client API for TransportPlugin service.
  26. //
  27. // 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.
  28. type TransportPluginClient interface {
  29. GetInfo(ctx context.Context, in *GetInfoRequest, opts ...grpc.CallOption) (*GetInfoResponse, error)
  30. Health(ctx context.Context, in *HealthRequest, opts ...grpc.CallOption) (*HealthResponse, error)
  31. ValidateConfig(ctx context.Context, in *ValidateConfigRequest, opts ...grpc.CallOption) (*ValidateConfigResponse, error)
  32. ApplyConfig(ctx context.Context, in *ApplyConfigRequest, opts ...grpc.CallOption) (*ApplyConfigResponse, error)
  33. TestConfig(ctx context.Context, in *TestConfigRequest, opts ...grpc.CallOption) (*TestConfigResponse, error)
  34. Forward(ctx context.Context, opts ...grpc.CallOption) (grpc.BidiStreamingClient[ForwardRequest, ForwardResponse], error)
  35. }
  36. type transportPluginClient struct {
  37. cc grpc.ClientConnInterface
  38. }
  39. func NewTransportPluginClient(cc grpc.ClientConnInterface) TransportPluginClient {
  40. return &transportPluginClient{cc}
  41. }
  42. func (c *transportPluginClient) GetInfo(ctx context.Context, in *GetInfoRequest, opts ...grpc.CallOption) (*GetInfoResponse, error) {
  43. cOpts := append([]grpc.CallOption{grpc.StaticMethod()}, opts...)
  44. out := new(GetInfoResponse)
  45. err := c.cc.Invoke(ctx, TransportPlugin_GetInfo_FullMethodName, in, out, cOpts...)
  46. if err != nil {
  47. return nil, err
  48. }
  49. return out, nil
  50. }
  51. func (c *transportPluginClient) Health(ctx context.Context, in *HealthRequest, opts ...grpc.CallOption) (*HealthResponse, error) {
  52. cOpts := append([]grpc.CallOption{grpc.StaticMethod()}, opts...)
  53. out := new(HealthResponse)
  54. err := c.cc.Invoke(ctx, TransportPlugin_Health_FullMethodName, in, out, cOpts...)
  55. if err != nil {
  56. return nil, err
  57. }
  58. return out, nil
  59. }
  60. func (c *transportPluginClient) ValidateConfig(ctx context.Context, in *ValidateConfigRequest, opts ...grpc.CallOption) (*ValidateConfigResponse, error) {
  61. cOpts := append([]grpc.CallOption{grpc.StaticMethod()}, opts...)
  62. out := new(ValidateConfigResponse)
  63. err := c.cc.Invoke(ctx, TransportPlugin_ValidateConfig_FullMethodName, in, out, cOpts...)
  64. if err != nil {
  65. return nil, err
  66. }
  67. return out, nil
  68. }
  69. func (c *transportPluginClient) ApplyConfig(ctx context.Context, in *ApplyConfigRequest, opts ...grpc.CallOption) (*ApplyConfigResponse, error) {
  70. cOpts := append([]grpc.CallOption{grpc.StaticMethod()}, opts...)
  71. out := new(ApplyConfigResponse)
  72. err := c.cc.Invoke(ctx, TransportPlugin_ApplyConfig_FullMethodName, in, out, cOpts...)
  73. if err != nil {
  74. return nil, err
  75. }
  76. return out, nil
  77. }
  78. func (c *transportPluginClient) TestConfig(ctx context.Context, in *TestConfigRequest, opts ...grpc.CallOption) (*TestConfigResponse, error) {
  79. cOpts := append([]grpc.CallOption{grpc.StaticMethod()}, opts...)
  80. out := new(TestConfigResponse)
  81. err := c.cc.Invoke(ctx, TransportPlugin_TestConfig_FullMethodName, in, out, cOpts...)
  82. if err != nil {
  83. return nil, err
  84. }
  85. return out, nil
  86. }
  87. func (c *transportPluginClient) Forward(ctx context.Context, opts ...grpc.CallOption) (grpc.BidiStreamingClient[ForwardRequest, ForwardResponse], error) {
  88. cOpts := append([]grpc.CallOption{grpc.StaticMethod()}, opts...)
  89. stream, err := c.cc.NewStream(ctx, &TransportPlugin_ServiceDesc.Streams[0], TransportPlugin_Forward_FullMethodName, cOpts...)
  90. if err != nil {
  91. return nil, err
  92. }
  93. x := &grpc.GenericClientStream[ForwardRequest, ForwardResponse]{ClientStream: stream}
  94. return x, nil
  95. }
  96. // This type alias is provided for backwards compatibility with existing code that references the prior non-generic stream type by name.
  97. type TransportPlugin_ForwardClient = grpc.BidiStreamingClient[ForwardRequest, ForwardResponse]
  98. // TransportPluginServer is the server API for TransportPlugin service.
  99. // All implementations must embed UnimplementedTransportPluginServer
  100. // for forward compatibility.
  101. type TransportPluginServer interface {
  102. GetInfo(context.Context, *GetInfoRequest) (*GetInfoResponse, error)
  103. Health(context.Context, *HealthRequest) (*HealthResponse, error)
  104. ValidateConfig(context.Context, *ValidateConfigRequest) (*ValidateConfigResponse, error)
  105. ApplyConfig(context.Context, *ApplyConfigRequest) (*ApplyConfigResponse, error)
  106. TestConfig(context.Context, *TestConfigRequest) (*TestConfigResponse, error)
  107. Forward(grpc.BidiStreamingServer[ForwardRequest, ForwardResponse]) error
  108. mustEmbedUnimplementedTransportPluginServer()
  109. }
  110. // UnimplementedTransportPluginServer must be embedded to have
  111. // forward compatible implementations.
  112. //
  113. // NOTE: this should be embedded by value instead of pointer to avoid a nil
  114. // pointer dereference when methods are called.
  115. type UnimplementedTransportPluginServer struct{}
  116. func (UnimplementedTransportPluginServer) GetInfo(context.Context, *GetInfoRequest) (*GetInfoResponse, error) {
  117. return nil, status.Error(codes.Unimplemented, "method GetInfo not implemented")
  118. }
  119. func (UnimplementedTransportPluginServer) Health(context.Context, *HealthRequest) (*HealthResponse, error) {
  120. return nil, status.Error(codes.Unimplemented, "method Health not implemented")
  121. }
  122. func (UnimplementedTransportPluginServer) ValidateConfig(context.Context, *ValidateConfigRequest) (*ValidateConfigResponse, error) {
  123. return nil, status.Error(codes.Unimplemented, "method ValidateConfig not implemented")
  124. }
  125. func (UnimplementedTransportPluginServer) ApplyConfig(context.Context, *ApplyConfigRequest) (*ApplyConfigResponse, error) {
  126. return nil, status.Error(codes.Unimplemented, "method ApplyConfig not implemented")
  127. }
  128. func (UnimplementedTransportPluginServer) TestConfig(context.Context, *TestConfigRequest) (*TestConfigResponse, error) {
  129. return nil, status.Error(codes.Unimplemented, "method TestConfig not implemented")
  130. }
  131. func (UnimplementedTransportPluginServer) Forward(grpc.BidiStreamingServer[ForwardRequest, ForwardResponse]) error {
  132. return status.Error(codes.Unimplemented, "method Forward not implemented")
  133. }
  134. func (UnimplementedTransportPluginServer) mustEmbedUnimplementedTransportPluginServer() {}
  135. func (UnimplementedTransportPluginServer) testEmbeddedByValue() {}
  136. // UnsafeTransportPluginServer may be embedded to opt out of forward compatibility for this service.
  137. // Use of this interface is not recommended, as added methods to TransportPluginServer will
  138. // result in compilation errors.
  139. type UnsafeTransportPluginServer interface {
  140. mustEmbedUnimplementedTransportPluginServer()
  141. }
  142. func RegisterTransportPluginServer(s grpc.ServiceRegistrar, srv TransportPluginServer) {
  143. // If the following call panics, it indicates UnimplementedTransportPluginServer was
  144. // embedded by pointer and is nil. This will cause panics if an
  145. // unimplemented method is ever invoked, so we test this at initialization
  146. // time to prevent it from happening at runtime later due to I/O.
  147. if t, ok := srv.(interface{ testEmbeddedByValue() }); ok {
  148. t.testEmbeddedByValue()
  149. }
  150. s.RegisterService(&TransportPlugin_ServiceDesc, srv)
  151. }
  152. func _TransportPlugin_GetInfo_Handler(srv interface{}, ctx context.Context, dec func(interface{}) error, interceptor grpc.UnaryServerInterceptor) (interface{}, error) {
  153. in := new(GetInfoRequest)
  154. if err := dec(in); err != nil {
  155. return nil, err
  156. }
  157. if interceptor == nil {
  158. return srv.(TransportPluginServer).GetInfo(ctx, in)
  159. }
  160. info := &grpc.UnaryServerInfo{
  161. Server: srv,
  162. FullMethod: TransportPlugin_GetInfo_FullMethodName,
  163. }
  164. handler := func(ctx context.Context, req interface{}) (interface{}, error) {
  165. return srv.(TransportPluginServer).GetInfo(ctx, req.(*GetInfoRequest))
  166. }
  167. return interceptor(ctx, in, info, handler)
  168. }
  169. func _TransportPlugin_Health_Handler(srv interface{}, ctx context.Context, dec func(interface{}) error, interceptor grpc.UnaryServerInterceptor) (interface{}, error) {
  170. in := new(HealthRequest)
  171. if err := dec(in); err != nil {
  172. return nil, err
  173. }
  174. if interceptor == nil {
  175. return srv.(TransportPluginServer).Health(ctx, in)
  176. }
  177. info := &grpc.UnaryServerInfo{
  178. Server: srv,
  179. FullMethod: TransportPlugin_Health_FullMethodName,
  180. }
  181. handler := func(ctx context.Context, req interface{}) (interface{}, error) {
  182. return srv.(TransportPluginServer).Health(ctx, req.(*HealthRequest))
  183. }
  184. return interceptor(ctx, in, info, handler)
  185. }
  186. func _TransportPlugin_ValidateConfig_Handler(srv interface{}, ctx context.Context, dec func(interface{}) error, interceptor grpc.UnaryServerInterceptor) (interface{}, error) {
  187. in := new(ValidateConfigRequest)
  188. if err := dec(in); err != nil {
  189. return nil, err
  190. }
  191. if interceptor == nil {
  192. return srv.(TransportPluginServer).ValidateConfig(ctx, in)
  193. }
  194. info := &grpc.UnaryServerInfo{
  195. Server: srv,
  196. FullMethod: TransportPlugin_ValidateConfig_FullMethodName,
  197. }
  198. handler := func(ctx context.Context, req interface{}) (interface{}, error) {
  199. return srv.(TransportPluginServer).ValidateConfig(ctx, req.(*ValidateConfigRequest))
  200. }
  201. return interceptor(ctx, in, info, handler)
  202. }
  203. func _TransportPlugin_ApplyConfig_Handler(srv interface{}, ctx context.Context, dec func(interface{}) error, interceptor grpc.UnaryServerInterceptor) (interface{}, error) {
  204. in := new(ApplyConfigRequest)
  205. if err := dec(in); err != nil {
  206. return nil, err
  207. }
  208. if interceptor == nil {
  209. return srv.(TransportPluginServer).ApplyConfig(ctx, in)
  210. }
  211. info := &grpc.UnaryServerInfo{
  212. Server: srv,
  213. FullMethod: TransportPlugin_ApplyConfig_FullMethodName,
  214. }
  215. handler := func(ctx context.Context, req interface{}) (interface{}, error) {
  216. return srv.(TransportPluginServer).ApplyConfig(ctx, req.(*ApplyConfigRequest))
  217. }
  218. return interceptor(ctx, in, info, handler)
  219. }
  220. func _TransportPlugin_TestConfig_Handler(srv interface{}, ctx context.Context, dec func(interface{}) error, interceptor grpc.UnaryServerInterceptor) (interface{}, error) {
  221. in := new(TestConfigRequest)
  222. if err := dec(in); err != nil {
  223. return nil, err
  224. }
  225. if interceptor == nil {
  226. return srv.(TransportPluginServer).TestConfig(ctx, in)
  227. }
  228. info := &grpc.UnaryServerInfo{
  229. Server: srv,
  230. FullMethod: TransportPlugin_TestConfig_FullMethodName,
  231. }
  232. handler := func(ctx context.Context, req interface{}) (interface{}, error) {
  233. return srv.(TransportPluginServer).TestConfig(ctx, req.(*TestConfigRequest))
  234. }
  235. return interceptor(ctx, in, info, handler)
  236. }
  237. func _TransportPlugin_Forward_Handler(srv interface{}, stream grpc.ServerStream) error {
  238. return srv.(TransportPluginServer).Forward(&grpc.GenericServerStream[ForwardRequest, ForwardResponse]{ServerStream: stream})
  239. }
  240. // This type alias is provided for backwards compatibility with existing code that references the prior non-generic stream type by name.
  241. type TransportPlugin_ForwardServer = grpc.BidiStreamingServer[ForwardRequest, ForwardResponse]
  242. // TransportPlugin_ServiceDesc is the grpc.ServiceDesc for TransportPlugin service.
  243. // It's only intended for direct use with grpc.RegisterService,
  244. // and not to be introspected or modified (even as a copy)
  245. var TransportPlugin_ServiceDesc = grpc.ServiceDesc{
  246. ServiceName: "sub2api.plugin.v1.TransportPlugin",
  247. HandlerType: (*TransportPluginServer)(nil),
  248. Methods: []grpc.MethodDesc{
  249. {
  250. MethodName: "GetInfo",
  251. Handler: _TransportPlugin_GetInfo_Handler,
  252. },
  253. {
  254. MethodName: "Health",
  255. Handler: _TransportPlugin_Health_Handler,
  256. },
  257. {
  258. MethodName: "ValidateConfig",
  259. Handler: _TransportPlugin_ValidateConfig_Handler,
  260. },
  261. {
  262. MethodName: "ApplyConfig",
  263. Handler: _TransportPlugin_ApplyConfig_Handler,
  264. },
  265. {
  266. MethodName: "TestConfig",
  267. Handler: _TransportPlugin_TestConfig_Handler,
  268. },
  269. },
  270. Streams: []grpc.StreamDesc{
  271. {
  272. StreamName: "Forward",
  273. Handler: _TransportPlugin_Forward_Handler,
  274. ServerStreams: true,
  275. ClientStreams: true,
  276. },
  277. },
  278. Metadata: "plugin.proto",
  279. }