Documentation ¶
Index ¶
- func PrepareShipmentAllocationEvent_Allocated(orderId string, orderMetadata EventOrderMetadata, shipmentId string, ...) ([]byte, string, error)
- func PrepareShipmentAllocationEvent_AllocationReleased(orderId string, shipmentId string, shipmentItems []*pb.ShipmentItem) ([]byte, string, error)
- func PrepareShipmentAllocationEvent_Failed(orderId string, orderMetadata EventOrderMetadata, ...) ([]byte, string, error)
- func PrepareShipmentDispatchedEvent(orderId string, shipmentId string, productQuantities map[string]int32) ([]byte, string, error)
- type ConsumerController
- type EventOrderMetadata
- type ServiceConfig
- type ShippingService
- func (svc ShippingService) ProcessPaymentProcessedEvent(ctx context.Context, req *eventpb.PaymentProcessedEvent) (*emptypb.Empty, error)
- func (svc ShippingService) ProcessStockReservationEvent(ctx context.Context, req *eventpb.StockReservationEvent) (*emptypb.Empty, error)
- func (svc ShippingService) ServiceInfo(ctx context.Context, req *commonpb.ServiceInfoRequest) (*commonpb.ServiceInfoResponse, error)
- func (svc ShippingService) ViewShipment(ctx context.Context, req *pb.ViewShipmentRequest) (*pb.ViewShipmentResponse, error)
- func (svc ShippingService) ViewShipmentManifest(ctx context.Context, req *pb.ViewShipmentManifestRequest) (*pb.ViewShipmentManifestResponse, error)
- type StorageController
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
Types ¶
type ConsumerController ¶
type ConsumerController interface { messaging.ConsumerController Attach(svc pb.ShippingServiceServer) }
Interface for event consumption Flexibility for seperate controllers for different messaging systems (e.g. Kafka, NATS, etc)
type EventOrderMetadata ¶
type ServiceConfig ¶
type ServiceConfig struct { config.SharedConfig // Dynamically loaded configuration Postgres config.PostgresConfig Kafka config.KafkaConfig }Shared
Order Service Configuration
func NewServiceConfig ¶
func NewServiceConfig() (*ServiceConfig, error)
load the base service configuration
type ShippingService ¶
type ShippingService struct { pb.UnimplementedShippingServiceServer // contains filtered or unexported fields }
Interface for the service
func NewShippingService ¶
func NewShippingService(cfg *ServiceConfig, store StorageController) *ShippingService
Create the shipping service
func (ShippingService) ProcessPaymentProcessedEvent ¶
func (svc ShippingService) ProcessPaymentProcessedEvent(ctx context.Context, req *eventpb.PaymentProcessedEvent) (*emptypb.Empty, error)
func (ShippingService) ProcessStockReservationEvent ¶
func (svc ShippingService) ProcessStockReservationEvent(ctx context.Context, req *eventpb.StockReservationEvent) (*emptypb.Empty, error)
func (ShippingService) ServiceInfo ¶
func (svc ShippingService) ServiceInfo(ctx context.Context, req *commonpb.ServiceInfoRequest) (*commonpb.ServiceInfoResponse, error)
func (ShippingService) ViewShipment ¶
func (svc ShippingService) ViewShipment(ctx context.Context, req *pb.ViewShipmentRequest) (*pb.ViewShipmentResponse, error)
func (ShippingService) ViewShipmentManifest ¶
func (svc ShippingService) ViewShipmentManifest(ctx context.Context, req *pb.ViewShipmentManifestRequest) (*pb.ViewShipmentManifestResponse, error)
type StorageController ¶
type StorageController interface { GetShipment(ctx context.Context, shipmentId string) (*pb.Shipment, error) GetShipmentItems(ctx context.Context, shipmentId string) ([]*pb.ShipmentItem, error) AllocateOrderShipment(ctx context.Context, orderId string, orderMetadata EventOrderMetadata, productQuantities map[string]int32) error CancelOrderShipment(ctx context.Context, orderId string) error }
Interface for database methods Flexibility for implementing seperate controllers for different databases (e.g. Postgres, MongoDB, etc)
Click to show internal directories.
Click to hide internal directories.