Documentation
¶
Index ¶
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
func NewBasicInventoryService ¶
func NewBasicInventoryService() *basicInventoryService
NewBasicInventoryService returns a naive, stateless implementation of IInventoryService
Types ¶
type IInventoryService ¶
type IInventoryService interface {
// Handlers of the events
HandleAccountCreatedEvent(ctx context.Context, aid uint, role string) error
HandlePolicyUpdatedEvent(ctx context.Context, method, sub, rtype, rid, act string) error
HandleOrderCreatedEvent(ctx context.Context, oid, pid uuid.UUID, status string, qty int, aid uint) error
HandleOrderApprovedEvent(ctx context.Context, oid uuid.UUID) error
HandleOrderCanceledEvent(ctx context.Context, oid uuid.UUID) error
CreateMerchant(ctx context.Context, aid uint, name string) dto.CreateMerchantResponse
ListMerchant(ctx context.Context, mids []uuid.UUID) dto.ListMerchantResponse
CreateProduct(ctx context.Context, aid uint, mid uuid.UUID, name, desc string, qty int, price float32) dto.CreateProductResponse
ListProduct(ctx context.Context, pids []uuid.UUID, qp *dto.BasicQueryParam) dto.ListProductResponse
}
func New ¶
func New(logger *cl.CustomLogger, mws []Middleware, svcconfs ...SvcConf) IInventoryService
New returns a InventoryService implementation with all of the expected config/middleware wired in.
type Middleware ¶
type Middleware func(IInventoryService) IInventoryService
Middleware represents service middleware type
func NewAuthzMW ¶
func NewAuthzMW(pe svcpe.PolicyEnforcer) Middleware
type SvcConf ¶
type SvcConf func(*basicInventoryService) error
func WithNATSEncodedConn ¶
func WithNATSEncodedConn(nc *nats.EncodedConn) SvcConf
func WithPolicyStorage ¶
func WithPolicyStorage(ps svcpe.PolicyStorage) SvcConf
func WithRepo ¶
func WithRepo(r repo.InventoryRepository) SvcConf
Click to show internal directories.
Click to hide internal directories.