// Code generated by protoc-gen-go-grpc. DO NOT EDIT. // versions: // - protoc-gen-go-grpc v1.5.1 // - protoc (unknown) // source: supply.proto package market 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.64.0 or later. const _ = grpc.SupportPackageIsVersion9 const ( Supply_Create_FullMethodName = "/market.Supply/Create" Supply_Get_FullMethodName = "/market.Supply/Get" Supply_Fetch_FullMethodName = "/market.Supply/Fetch" Supply_Modify_FullMethodName = "/market.Supply/Modify" Supply_Delete_FullMethodName = "/market.Supply/Delete" ) // SupplyClient is the client API for Supply 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 SupplyClient interface { // 新增供应商 Create(ctx context.Context, in *MarketSupplyItem, opts ...grpc.CallOption) (*StatusReply, error) // 获取一个供应商 Get(ctx context.Context, in *IdentRequest, opts ...grpc.CallOption) (*MarketSupplyItem, error) // 供应商列表 Fetch(ctx context.Context, in *FetchRequest, opts ...grpc.CallOption) (*SupplyReply, error) // 更新供应商数据 Modify(ctx context.Context, in *MarketSupplyItem, opts ...grpc.CallOption) (*StatusReply, error) // 删除一个供应商 Delete(ctx context.Context, in *IdentRequest, opts ...grpc.CallOption) (*StatusReply, error) } type supplyClient struct { cc grpc.ClientConnInterface } func NewSupplyClient(cc grpc.ClientConnInterface) SupplyClient { return &supplyClient{cc} } func (c *supplyClient) Create(ctx context.Context, in *MarketSupplyItem, opts ...grpc.CallOption) (*StatusReply, error) { cOpts := append([]grpc.CallOption{grpc.StaticMethod()}, opts...) out := new(StatusReply) err := c.cc.Invoke(ctx, Supply_Create_FullMethodName, in, out, cOpts...) if err != nil { return nil, err } return out, nil } func (c *supplyClient) Get(ctx context.Context, in *IdentRequest, opts ...grpc.CallOption) (*MarketSupplyItem, error) { cOpts := append([]grpc.CallOption{grpc.StaticMethod()}, opts...) out := new(MarketSupplyItem) err := c.cc.Invoke(ctx, Supply_Get_FullMethodName, in, out, cOpts...) if err != nil { return nil, err } return out, nil } func (c *supplyClient) Fetch(ctx context.Context, in *FetchRequest, opts ...grpc.CallOption) (*SupplyReply, error) { cOpts := append([]grpc.CallOption{grpc.StaticMethod()}, opts...) out := new(SupplyReply) err := c.cc.Invoke(ctx, Supply_Fetch_FullMethodName, in, out, cOpts...) if err != nil { return nil, err } return out, nil } func (c *supplyClient) Modify(ctx context.Context, in *MarketSupplyItem, opts ...grpc.CallOption) (*StatusReply, error) { cOpts := append([]grpc.CallOption{grpc.StaticMethod()}, opts...) out := new(StatusReply) err := c.cc.Invoke(ctx, Supply_Modify_FullMethodName, in, out, cOpts...) if err != nil { return nil, err } return out, nil } func (c *supplyClient) Delete(ctx context.Context, in *IdentRequest, opts ...grpc.CallOption) (*StatusReply, error) { cOpts := append([]grpc.CallOption{grpc.StaticMethod()}, opts...) out := new(StatusReply) err := c.cc.Invoke(ctx, Supply_Delete_FullMethodName, in, out, cOpts...) if err != nil { return nil, err } return out, nil } // SupplyServer is the server API for Supply service. // All implementations must embed UnimplementedSupplyServer // for forward compatibility. // // 营销服务 - 供应商 type SupplyServer interface { // 新增供应商 Create(context.Context, *MarketSupplyItem) (*StatusReply, error) // 获取一个供应商 Get(context.Context, *IdentRequest) (*MarketSupplyItem, error) // 供应商列表 Fetch(context.Context, *FetchRequest) (*SupplyReply, error) // 更新供应商数据 Modify(context.Context, *MarketSupplyItem) (*StatusReply, error) // 删除一个供应商 Delete(context.Context, *IdentRequest) (*StatusReply, error) mustEmbedUnimplementedSupplyServer() } // UnimplementedSupplyServer must be embedded to have // forward compatible implementations. // // NOTE: this should be embedded by value instead of pointer to avoid a nil // pointer dereference when methods are called. type UnimplementedSupplyServer struct{} func (UnimplementedSupplyServer) Create(context.Context, *MarketSupplyItem) (*StatusReply, error) { return nil, status.Errorf(codes.Unimplemented, "method Create not implemented") } func (UnimplementedSupplyServer) Get(context.Context, *IdentRequest) (*MarketSupplyItem, error) { return nil, status.Errorf(codes.Unimplemented, "method Get not implemented") } func (UnimplementedSupplyServer) Fetch(context.Context, *FetchRequest) (*SupplyReply, error) { return nil, status.Errorf(codes.Unimplemented, "method Fetch not implemented") } func (UnimplementedSupplyServer) Modify(context.Context, *MarketSupplyItem) (*StatusReply, error) { return nil, status.Errorf(codes.Unimplemented, "method Modify not implemented") } func (UnimplementedSupplyServer) Delete(context.Context, *IdentRequest) (*StatusReply, error) { return nil, status.Errorf(codes.Unimplemented, "method Delete not implemented") } func (UnimplementedSupplyServer) mustEmbedUnimplementedSupplyServer() {} func (UnimplementedSupplyServer) testEmbeddedByValue() {} // UnsafeSupplyServer may be embedded to opt out of forward compatibility for this service. // Use of this interface is not recommended, as added methods to SupplyServer will // result in compilation errors. type UnsafeSupplyServer interface { mustEmbedUnimplementedSupplyServer() } func RegisterSupplyServer(s grpc.ServiceRegistrar, srv SupplyServer) { // If the following call pancis, it indicates UnimplementedSupplyServer was // embedded by pointer and is nil. This will cause panics if an // unimplemented method is ever invoked, so we test this at initialization // time to prevent it from happening at runtime later due to I/O. if t, ok := srv.(interface{ testEmbeddedByValue() }); ok { t.testEmbeddedByValue() } s.RegisterService(&Supply_ServiceDesc, srv) } func _Supply_Create_Handler(srv interface{}, ctx context.Context, dec func(interface{}) error, interceptor grpc.UnaryServerInterceptor) (interface{}, error) { in := new(MarketSupplyItem) if err := dec(in); err != nil { return nil, err } if interceptor == nil { return srv.(SupplyServer).Create(ctx, in) } info := &grpc.UnaryServerInfo{ Server: srv, FullMethod: Supply_Create_FullMethodName, } handler := func(ctx context.Context, req interface{}) (interface{}, error) { return srv.(SupplyServer).Create(ctx, req.(*MarketSupplyItem)) } return interceptor(ctx, in, info, handler) } func _Supply_Get_Handler(srv interface{}, ctx context.Context, dec func(interface{}) error, interceptor grpc.UnaryServerInterceptor) (interface{}, error) { in := new(IdentRequest) if err := dec(in); err != nil { return nil, err } if interceptor == nil { return srv.(SupplyServer).Get(ctx, in) } info := &grpc.UnaryServerInfo{ Server: srv, FullMethod: Supply_Get_FullMethodName, } handler := func(ctx context.Context, req interface{}) (interface{}, error) { return srv.(SupplyServer).Get(ctx, req.(*IdentRequest)) } return interceptor(ctx, in, info, handler) } func _Supply_Fetch_Handler(srv interface{}, ctx context.Context, dec func(interface{}) error, interceptor grpc.UnaryServerInterceptor) (interface{}, error) { in := new(FetchRequest) if err := dec(in); err != nil { return nil, err } if interceptor == nil { return srv.(SupplyServer).Fetch(ctx, in) } info := &grpc.UnaryServerInfo{ Server: srv, FullMethod: Supply_Fetch_FullMethodName, } handler := func(ctx context.Context, req interface{}) (interface{}, error) { return srv.(SupplyServer).Fetch(ctx, req.(*FetchRequest)) } return interceptor(ctx, in, info, handler) } func _Supply_Modify_Handler(srv interface{}, ctx context.Context, dec func(interface{}) error, interceptor grpc.UnaryServerInterceptor) (interface{}, error) { in := new(MarketSupplyItem) if err := dec(in); err != nil { return nil, err } if interceptor == nil { return srv.(SupplyServer).Modify(ctx, in) } info := &grpc.UnaryServerInfo{ Server: srv, FullMethod: Supply_Modify_FullMethodName, } handler := func(ctx context.Context, req interface{}) (interface{}, error) { return srv.(SupplyServer).Modify(ctx, req.(*MarketSupplyItem)) } return interceptor(ctx, in, info, handler) } func _Supply_Delete_Handler(srv interface{}, ctx context.Context, dec func(interface{}) error, interceptor grpc.UnaryServerInterceptor) (interface{}, error) { in := new(IdentRequest) if err := dec(in); err != nil { return nil, err } if interceptor == nil { return srv.(SupplyServer).Delete(ctx, in) } info := &grpc.UnaryServerInfo{ Server: srv, FullMethod: Supply_Delete_FullMethodName, } handler := func(ctx context.Context, req interface{}) (interface{}, error) { return srv.(SupplyServer).Delete(ctx, req.(*IdentRequest)) } return interceptor(ctx, in, info, handler) } // Supply_ServiceDesc is the grpc.ServiceDesc for Supply service. // It's only intended for direct use with grpc.RegisterService, // and not to be introspected or modified (even as a copy) var Supply_ServiceDesc = grpc.ServiceDesc{ ServiceName: "market.Supply", HandlerType: (*SupplyServer)(nil), Methods: []grpc.MethodDesc{ { MethodName: "Create", Handler: _Supply_Create_Handler, }, { MethodName: "Get", Handler: _Supply_Get_Handler, }, { MethodName: "Fetch", Handler: _Supply_Fetch_Handler, }, { MethodName: "Modify", Handler: _Supply_Modify_Handler, }, { MethodName: "Delete", Handler: _Supply_Delete_Handler, }, }, Streams: []grpc.StreamDesc{}, Metadata: "supply.proto", }