Documentation ¶
Index ¶
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
func AuthInterceptor ¶
func AuthInterceptor(ctx context.Context, req interface{}, info *grpc.UnaryServerInfo, handler grpc.UnaryHandler) (interface{}, error)
Types ¶
type GRPCService ¶
type GRPCService struct { ProductSvc *ProductSvc // contains filtered or unexported fields }
GRPCService ...
func BuildGRPCService ¶
func BuildGRPCService(server *grpc.Server, repository repository.Repository) *GRPCService
BuildGRPCService register gRPC services implementation
type JwtClaims ¶
type JwtClaims struct { jwt.StandardClaims UserID string `json:"userid"` DeviceID string `json:"dvcid"` UserNo int `json:"userno"` Username string `json:"username"` Email string `json:"email"` Phone string `json:"phone"` }
JwtClaims is wrapper for claiming JWT during login process
type ProductSvc ¶
type ProductSvc struct {
// contains filtered or unexported fields
}
ProductService
func NewProductSvc ¶
func NewProductSvc(prepo repository.ProductRepository, log *logrus.Logger) *ProductSvc
Instantiate new user Service
func (*ProductSvc) Create ¶
func (s *ProductSvc) Create(ctx context.Context, p *pb.ProductDto) (*pb.ProductDto, error)
CreateProduct ...
func (*ProductSvc) GetProductByID ¶
func (s *ProductSvc) GetProductByID(ctx context.Context, id *wrappers.StringValue) (*pb.ProductDto, error)
GetProductByID will return product detail
func (*ProductSvc) ListProduct ¶
func (s *ProductSvc) ListProduct(ctx context.Context, e *empty.Empty) (*pb.ProductDtoList, error)
ListProducts will return all product
Click to show internal directories.
Click to hide internal directories.