services

package
v0.0.0-...-5661f94 Latest Latest
Warning

This package is not in the latest version of its module.

Go to latest
Published: Jan 4, 2022 License: Apache-2.0 Imports: 11 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type ProductService

type ProductService interface {
	AddProduct(ctx context.Context, jwtToken string, newProduct *products.Product) (*products.Product, error)
	GetProduct(ctx context.Context, sku string) (*products.Product, error)
}

ProductService is the interface that describes a product service.

type ProductServiceImpl

type ProductServiceImpl struct {
	// contains filtered or unexported fields
}

ProductServiceImpl is the default implementation for ProductService interface.

func NewProductService

func NewProductService(
	productRepo products.Repository,
	userServiceClient proto.UserServiceClient,
	natsConn *nats.Conn,
	tracer opentracing.Tracer,
) *ProductServiceImpl

NewProductService returns a new product service object.

func (*ProductServiceImpl) AddProduct

func (s *ProductServiceImpl) AddProduct(ctx context.Context, jwtToken string, newProduct *products.Product) (*products.Product, error)

func (*ProductServiceImpl) GetProduct

func (s *ProductServiceImpl) GetProduct(ctx context.Context, sku string) (*products.Product, error)

Jump to

Keyboard shortcuts

? : This menu
/ : Search site
f or F : Jump to
y or Y : Canonical URL