Documentation ¶
Index ¶
- func DecodeCreateProductRequest(_ context.Context, r interface{}) (interface{}, error)
- func DecodeGetProductRequest(_ context.Context, r interface{}) (interface{}, error)
- func EncodeProductResponse(_ context.Context, r interface{}) (interface{}, error)
- func MakeCreateProductEndpoint(svc Service) endpoint.Endpoint
- func MakeGetProductEndpoint(svc Service) endpoint.Endpoint
- func NewGRPCServer(_ context.Context, endpoint Endpoints) pb.ProductServer
- type CreateProductRequest
- type Endpoints
- type GRPCServer
- type GetProductRequest
- type ProductResponse
- type ProductService
- type Service
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
func DecodeGetProductRequest ¶
func EncodeProductResponse ¶
func MakeGetProductEndpoint ¶
func NewGRPCServer ¶
func NewGRPCServer(_ context.Context, endpoint Endpoints) pb.ProductServer
Types ¶
type CreateProductRequest ¶
type CreateProductRequest struct {
Name string
}
type GRPCServer ¶
type GRPCServer struct {
// contains filtered or unexported fields
}
func (*GRPCServer) CreateProduct ¶
func (s *GRPCServer) CreateProduct(ctx context.Context, req *pb.CreateProductRequest) (*pb.ProductResponse, error)
func (*GRPCServer) GetProduct ¶
func (s *GRPCServer) GetProduct(ctx context.Context, req *pb.GetProductRequest) (*pb.ProductResponse, error)
type GetProductRequest ¶
type GetProductRequest struct {
ID int32
}
type ProductResponse ¶
type ProductService ¶
type ProductService struct {
Repository database.ProductRepository
}
func (*ProductService) CreateProduct ¶
func (s *ProductService) CreateProduct(name string) (*database.Product, error)
func (*ProductService) GetProduct ¶
func (s *ProductService) GetProduct(id int32) (*database.Product, error)
Click to show internal directories.
Click to hide internal directories.