Documentation ¶
Index ¶
- func AuthInterceptor(ctx context.Context, req interface{}, info *grpc.UnaryServerInfo, ...) (interface{}, error)
- type GRPCService
- type JwtClaims
- type OrderSvc
- func (s *OrderSvc) Create(ctx context.Context, ord *pb.OrderReqDto) (*pb.OrderDto, error)
- func (s *OrderSvc) GetOrderByID(ctx context.Context, id *wrappers.StringValue) (*pb.OrderDto, error)
- func (s *OrderSvc) ListOrderByUserID(ctx context.Context, userId *wrappers.StringValue) (*pb.OrderDtoList, error)
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 { OrderSvc *OrderSvc // 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 OrderSvc ¶
type OrderSvc struct {
// contains filtered or unexported fields
}
OrderService
func NewOrderSvc ¶
func NewOrderSvc(orepo repository.OrderRepository, log *logrus.Logger) *OrderSvc
Instantiate new user Service
func (*OrderSvc) GetOrderByID ¶
func (s *OrderSvc) GetOrderByID(ctx context.Context, id *wrappers.StringValue) (*pb.OrderDto, error)
GetOrderByID will return product detail
func (*OrderSvc) ListOrderByUserID ¶
func (s *OrderSvc) ListOrderByUserID(ctx context.Context, userId *wrappers.StringValue) (*pb.OrderDtoList, error)
ListOrderByUserID will return all product with date choosen
Click to show internal directories.
Click to hide internal directories.