123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265 |
- // Copyright 2023 EMQ Technologies Co., Ltd.
- //
- // Licensed under the Apache License, Version 2.0 (the "License");
- // you may not use this file except in compliance with the License.
- // You may obtain a copy of the License at
- //
- // http://www.apache.org/licenses/LICENSE-2.0
- //
- // Unless required by applicable law or agreed to in writing, software
- // distributed under the License is distributed on an "AS IS" BASIS,
- // WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
- // See the License for the specific language governing permissions and
- // limitations under the License.
- // Code generated by protoc-gen-go-grpc. DO NOT EDIT.
- package service
- import (
- context "context"
- empty "github.com/golang/protobuf/ptypes/empty"
- wrappers "github.com/golang/protobuf/ptypes/wrappers"
- 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
- // GreeterClient is the client API for Greeter 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 GreeterClient interface {
- // Sends a greeting
- SayHello(ctx context.Context, in *HelloRequest, opts ...grpc.CallOption) (*HelloReply, error)
- Compute(ctx context.Context, in *InferRequest, opts ...grpc.CallOption) (*Response, error)
- // Primitive type param. Not supported for rest json
- GetFeature(ctx context.Context, in *wrappers.BytesValue, opts ...grpc.CallOption) (*FeatureResponse, error)
- ObjectDetection(ctx context.Context, in *ObjectDetectionRequest, opts ...grpc.CallOption) (*ObjectDetectionResponse, error)
- GetStatus(ctx context.Context, in *empty.Empty, opts ...grpc.CallOption) (*wrappers.BoolValue, error)
- }
- type greeterClient struct {
- cc grpc.ClientConnInterface
- }
- func NewGreeterClient(cc grpc.ClientConnInterface) GreeterClient {
- return &greeterClient{cc}
- }
- func (c *greeterClient) SayHello(ctx context.Context, in *HelloRequest, opts ...grpc.CallOption) (*HelloReply, error) {
- out := new(HelloReply)
- err := c.cc.Invoke(ctx, "/helloworld.Greeter/SayHello", in, out, opts...)
- if err != nil {
- return nil, err
- }
- return out, nil
- }
- func (c *greeterClient) Compute(ctx context.Context, in *InferRequest, opts ...grpc.CallOption) (*Response, error) {
- out := new(Response)
- err := c.cc.Invoke(ctx, "/helloworld.Greeter/Compute", in, out, opts...)
- if err != nil {
- return nil, err
- }
- return out, nil
- }
- func (c *greeterClient) GetFeature(ctx context.Context, in *wrappers.BytesValue, opts ...grpc.CallOption) (*FeatureResponse, error) {
- out := new(FeatureResponse)
- err := c.cc.Invoke(ctx, "/helloworld.Greeter/get_feature", in, out, opts...)
- if err != nil {
- return nil, err
- }
- return out, nil
- }
- func (c *greeterClient) ObjectDetection(ctx context.Context, in *ObjectDetectionRequest, opts ...grpc.CallOption) (*ObjectDetectionResponse, error) {
- out := new(ObjectDetectionResponse)
- err := c.cc.Invoke(ctx, "/helloworld.Greeter/object_detection", in, out, opts...)
- if err != nil {
- return nil, err
- }
- return out, nil
- }
- func (c *greeterClient) GetStatus(ctx context.Context, in *empty.Empty, opts ...grpc.CallOption) (*wrappers.BoolValue, error) {
- out := new(wrappers.BoolValue)
- err := c.cc.Invoke(ctx, "/helloworld.Greeter/getStatus", in, out, opts...)
- if err != nil {
- return nil, err
- }
- return out, nil
- }
- // GreeterServer is the server API for Greeter service.
- // All implementations must embed UnimplementedGreeterServer
- // for forward compatibility
- type GreeterServer interface {
- // Sends a greeting
- SayHello(context.Context, *HelloRequest) (*HelloReply, error)
- Compute(context.Context, *InferRequest) (*Response, error)
- // Primitive type param. Not supported for rest json
- GetFeature(context.Context, *wrappers.BytesValue) (*FeatureResponse, error)
- ObjectDetection(context.Context, *ObjectDetectionRequest) (*ObjectDetectionResponse, error)
- GetStatus(context.Context, *empty.Empty) (*wrappers.BoolValue, error)
- mustEmbedUnimplementedGreeterServer()
- }
- // UnimplementedGreeterServer must be embedded to have forward compatible implementations.
- type UnimplementedGreeterServer struct {
- }
- func (UnimplementedGreeterServer) SayHello(context.Context, *HelloRequest) (*HelloReply, error) {
- return nil, status.Errorf(codes.Unimplemented, "method SayHello not implemented")
- }
- func (UnimplementedGreeterServer) Compute(context.Context, *InferRequest) (*Response, error) {
- return nil, status.Errorf(codes.Unimplemented, "method Compute not implemented")
- }
- func (UnimplementedGreeterServer) GetFeature(context.Context, *wrappers.BytesValue) (*FeatureResponse, error) {
- return nil, status.Errorf(codes.Unimplemented, "method GetFeature not implemented")
- }
- func (UnimplementedGreeterServer) ObjectDetection(context.Context, *ObjectDetectionRequest) (*ObjectDetectionResponse, error) {
- return nil, status.Errorf(codes.Unimplemented, "method ObjectDetection not implemented")
- }
- func (UnimplementedGreeterServer) GetStatus(context.Context, *empty.Empty) (*wrappers.BoolValue, error) {
- return nil, status.Errorf(codes.Unimplemented, "method GetStatus not implemented")
- }
- func (UnimplementedGreeterServer) mustEmbedUnimplementedGreeterServer() {}
- // UnsafeGreeterServer may be embedded to opt out of forward compatibility for this service.
- // Use of this interface is not recommended, as added methods to GreeterServer will
- // result in compilation errors.
- type UnsafeGreeterServer interface {
- mustEmbedUnimplementedGreeterServer()
- }
- func RegisterGreeterServer(s grpc.ServiceRegistrar, srv GreeterServer) {
- s.RegisterService(&Greeter_ServiceDesc, srv)
- }
- func _Greeter_SayHello_Handler(srv interface{}, ctx context.Context, dec func(interface{}) error, interceptor grpc.UnaryServerInterceptor) (interface{}, error) {
- in := new(HelloRequest)
- if err := dec(in); err != nil {
- return nil, err
- }
- if interceptor == nil {
- return srv.(GreeterServer).SayHello(ctx, in)
- }
- info := &grpc.UnaryServerInfo{
- Server: srv,
- FullMethod: "/helloworld.Greeter/SayHello",
- }
- handler := func(ctx context.Context, req interface{}) (interface{}, error) {
- return srv.(GreeterServer).SayHello(ctx, req.(*HelloRequest))
- }
- return interceptor(ctx, in, info, handler)
- }
- func _Greeter_Compute_Handler(srv interface{}, ctx context.Context, dec func(interface{}) error, interceptor grpc.UnaryServerInterceptor) (interface{}, error) {
- in := new(InferRequest)
- if err := dec(in); err != nil {
- return nil, err
- }
- if interceptor == nil {
- return srv.(GreeterServer).Compute(ctx, in)
- }
- info := &grpc.UnaryServerInfo{
- Server: srv,
- FullMethod: "/helloworld.Greeter/Compute",
- }
- handler := func(ctx context.Context, req interface{}) (interface{}, error) {
- return srv.(GreeterServer).Compute(ctx, req.(*InferRequest))
- }
- return interceptor(ctx, in, info, handler)
- }
- func _Greeter_GetFeature_Handler(srv interface{}, ctx context.Context, dec func(interface{}) error, interceptor grpc.UnaryServerInterceptor) (interface{}, error) {
- in := new(wrappers.BytesValue)
- if err := dec(in); err != nil {
- return nil, err
- }
- if interceptor == nil {
- return srv.(GreeterServer).GetFeature(ctx, in)
- }
- info := &grpc.UnaryServerInfo{
- Server: srv,
- FullMethod: "/helloworld.Greeter/get_feature",
- }
- handler := func(ctx context.Context, req interface{}) (interface{}, error) {
- return srv.(GreeterServer).GetFeature(ctx, req.(*wrappers.BytesValue))
- }
- return interceptor(ctx, in, info, handler)
- }
- func _Greeter_ObjectDetection_Handler(srv interface{}, ctx context.Context, dec func(interface{}) error, interceptor grpc.UnaryServerInterceptor) (interface{}, error) {
- in := new(ObjectDetectionRequest)
- if err := dec(in); err != nil {
- return nil, err
- }
- if interceptor == nil {
- return srv.(GreeterServer).ObjectDetection(ctx, in)
- }
- info := &grpc.UnaryServerInfo{
- Server: srv,
- FullMethod: "/helloworld.Greeter/object_detection",
- }
- handler := func(ctx context.Context, req interface{}) (interface{}, error) {
- return srv.(GreeterServer).ObjectDetection(ctx, req.(*ObjectDetectionRequest))
- }
- return interceptor(ctx, in, info, handler)
- }
- func _Greeter_GetStatus_Handler(srv interface{}, ctx context.Context, dec func(interface{}) error, interceptor grpc.UnaryServerInterceptor) (interface{}, error) {
- in := new(empty.Empty)
- if err := dec(in); err != nil {
- return nil, err
- }
- if interceptor == nil {
- return srv.(GreeterServer).GetStatus(ctx, in)
- }
- info := &grpc.UnaryServerInfo{
- Server: srv,
- FullMethod: "/helloworld.Greeter/getStatus",
- }
- handler := func(ctx context.Context, req interface{}) (interface{}, error) {
- return srv.(GreeterServer).GetStatus(ctx, req.(*empty.Empty))
- }
- return interceptor(ctx, in, info, handler)
- }
- // Greeter_ServiceDesc is the grpc.ServiceDesc for Greeter service.
- // It's only intended for direct use with grpc.RegisterService,
- // and not to be introspected or modified (even as a copy)
- var Greeter_ServiceDesc = grpc.ServiceDesc{
- ServiceName: "helloworld.Greeter",
- HandlerType: (*GreeterServer)(nil),
- Methods: []grpc.MethodDesc{
- {
- MethodName: "SayHello",
- Handler: _Greeter_SayHello_Handler,
- },
- {
- MethodName: "Compute",
- Handler: _Greeter_Compute_Handler,
- },
- {
- MethodName: "get_feature",
- Handler: _Greeter_GetFeature_Handler,
- },
- {
- MethodName: "object_detection",
- Handler: _Greeter_ObjectDetection_Handler,
- },
- {
- MethodName: "getStatus",
- Handler: _Greeter_GetStatus_Handler,
- },
- },
- Streams: []grpc.StreamDesc{},
- Metadata: "hw.proto",
- }
|