123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155 |
- // Code generated by protoc-gen-micro. DO NOT EDIT.
- // source: proto/shopping_product_service.proto
- package shopping_service
- import (
- fmt "fmt"
- proto "google.golang.org/protobuf/proto"
- math "math"
- )
- import (
- context "context"
- api "go-micro.dev/v4/api"
- client "go-micro.dev/v4/client"
- server "go-micro.dev/v4/server"
- )
- // Reference imports to suppress errors if they are not otherwise used.
- var _ = proto.Marshal
- var _ = fmt.Errorf
- var _ = math.Inf
- // Reference imports to suppress errors if they are not otherwise used.
- var _ api.Endpoint
- var _ context.Context
- var _ client.Option
- var _ server.Option
- // Api Endpoints for ShoppingProductService service
- func NewShoppingProductServiceEndpoints() []*api.Endpoint {
- return []*api.Endpoint{}
- }
- // Client API for ShoppingProductService service
- type ShoppingProductService interface {
- GetProductList(ctx context.Context, in *GetProductListRequest, opts ...client.CallOption) (*GetProductListResponse, error)
- GetProduct(ctx context.Context, in *GetProductRequest, opts ...client.CallOption) (*GetProductResponse, error)
- CreateProduct(ctx context.Context, in *CreateProductRequest, opts ...client.CallOption) (*CreateProductResponse, error)
- UpdateProduct(ctx context.Context, in *UpdateProductRequest, opts ...client.CallOption) (*UpdateProductResponse, error)
- DeleteProduct(ctx context.Context, in *DeleteProductRequest, opts ...client.CallOption) (*DeleteProductResponse, error)
- }
- type shoppingProductService struct {
- c client.Client
- name string
- }
- func NewShoppingProductService(name string, c client.Client) ShoppingProductService {
- return &shoppingProductService{
- c: c,
- name: name,
- }
- }
- func (c *shoppingProductService) GetProductList(ctx context.Context, in *GetProductListRequest, opts ...client.CallOption) (*GetProductListResponse, error) {
- req := c.c.NewRequest(c.name, "ShoppingProductService.GetProductList", in)
- out := new(GetProductListResponse)
- err := c.c.Call(ctx, req, out, opts...)
- if err != nil {
- return nil, err
- }
- return out, nil
- }
- func (c *shoppingProductService) GetProduct(ctx context.Context, in *GetProductRequest, opts ...client.CallOption) (*GetProductResponse, error) {
- req := c.c.NewRequest(c.name, "ShoppingProductService.GetProduct", in)
- out := new(GetProductResponse)
- err := c.c.Call(ctx, req, out, opts...)
- if err != nil {
- return nil, err
- }
- return out, nil
- }
- func (c *shoppingProductService) CreateProduct(ctx context.Context, in *CreateProductRequest, opts ...client.CallOption) (*CreateProductResponse, error) {
- req := c.c.NewRequest(c.name, "ShoppingProductService.CreateProduct", in)
- out := new(CreateProductResponse)
- err := c.c.Call(ctx, req, out, opts...)
- if err != nil {
- return nil, err
- }
- return out, nil
- }
- func (c *shoppingProductService) UpdateProduct(ctx context.Context, in *UpdateProductRequest, opts ...client.CallOption) (*UpdateProductResponse, error) {
- req := c.c.NewRequest(c.name, "ShoppingProductService.UpdateProduct", in)
- out := new(UpdateProductResponse)
- err := c.c.Call(ctx, req, out, opts...)
- if err != nil {
- return nil, err
- }
- return out, nil
- }
- func (c *shoppingProductService) DeleteProduct(ctx context.Context, in *DeleteProductRequest, opts ...client.CallOption) (*DeleteProductResponse, error) {
- req := c.c.NewRequest(c.name, "ShoppingProductService.DeleteProduct", in)
- out := new(DeleteProductResponse)
- err := c.c.Call(ctx, req, out, opts...)
- if err != nil {
- return nil, err
- }
- return out, nil
- }
- // Server API for ShoppingProductService service
- type ShoppingProductServiceHandler interface {
- GetProductList(context.Context, *GetProductListRequest, *GetProductListResponse) error
- GetProduct(context.Context, *GetProductRequest, *GetProductResponse) error
- CreateProduct(context.Context, *CreateProductRequest, *CreateProductResponse) error
- UpdateProduct(context.Context, *UpdateProductRequest, *UpdateProductResponse) error
- DeleteProduct(context.Context, *DeleteProductRequest, *DeleteProductResponse) error
- }
- func RegisterShoppingProductServiceHandler(s server.Server, hdlr ShoppingProductServiceHandler, opts ...server.HandlerOption) error {
- type shoppingProductService interface {
- GetProductList(ctx context.Context, in *GetProductListRequest, out *GetProductListResponse) error
- GetProduct(ctx context.Context, in *GetProductRequest, out *GetProductResponse) error
- CreateProduct(ctx context.Context, in *CreateProductRequest, out *CreateProductResponse) error
- UpdateProduct(ctx context.Context, in *UpdateProductRequest, out *UpdateProductResponse) error
- DeleteProduct(ctx context.Context, in *DeleteProductRequest, out *DeleteProductResponse) error
- }
- type ShoppingProductService struct {
- shoppingProductService
- }
- h := &shoppingProductServiceHandler{hdlr}
- return s.Handle(s.NewHandler(&ShoppingProductService{h}, opts...))
- }
- type shoppingProductServiceHandler struct {
- ShoppingProductServiceHandler
- }
- func (h *shoppingProductServiceHandler) GetProductList(ctx context.Context, in *GetProductListRequest, out *GetProductListResponse) error {
- return h.ShoppingProductServiceHandler.GetProductList(ctx, in, out)
- }
- func (h *shoppingProductServiceHandler) GetProduct(ctx context.Context, in *GetProductRequest, out *GetProductResponse) error {
- return h.ShoppingProductServiceHandler.GetProduct(ctx, in, out)
- }
- func (h *shoppingProductServiceHandler) CreateProduct(ctx context.Context, in *CreateProductRequest, out *CreateProductResponse) error {
- return h.ShoppingProductServiceHandler.CreateProduct(ctx, in, out)
- }
- func (h *shoppingProductServiceHandler) UpdateProduct(ctx context.Context, in *UpdateProductRequest, out *UpdateProductResponse) error {
- return h.ShoppingProductServiceHandler.UpdateProduct(ctx, in, out)
- }
- func (h *shoppingProductServiceHandler) DeleteProduct(ctx context.Context, in *DeleteProductRequest, out *DeleteProductResponse) error {
- return h.ShoppingProductServiceHandler.DeleteProduct(ctx, in, out)
- }
|