Documentation ¶
Index ¶
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
func MakeHandler ¶
func MakeHandler(endpoints CustomerEndpoints, logger kitlog.Logger, ot stdopentracing.Tracer) http.Handler
Types ¶
type Customer ¶
Customer represents the customer model
func NewCustomer ¶
NewCustomer init a new customer with name and address.
type CustomerEndpoints ¶
func NewCustomerEndpoint ¶
func NewCustomerEndpoint(cs Service, ot stdopentracing.Tracer) CustomerEndpoints
NewCustomerEndpoint wraps all customer service with all middlewares
type Middleware ¶
func NewInstrumentService ¶
func NewInstrumentService(counter metrics.Counter, histogram metrics.Histogram) Middleware
func NewLoggingService ¶
func NewLoggingService(logger log.Logger) Middleware
NewLoggingService init a logging service
type ProxyMiddleware ¶
type ProxyMiddleware func(ProxyService) ProxyService
func NewProxyMiddleware ¶
func NewProxyMiddleware(conn *grpc.ClientConn, ctx context.Context, ot stdopentracing.Tracer, logger log.Logger) ProxyMiddleware
type ProxyService ¶
type Repository ¶
type Repository interface { Store(c *Customer) error GetByID(q string) (*Customer, error) Update(c *Customer) error Delete(c *Customer) error }
Repository represent database/cache business
type Service ¶
type Service interface { //Register customer Register(ctx context.Context, name, address string) error // Customer rent a dvd Rent(ctx context.Context, customerID, dvdID string) error }
Service describe customer business
func NewCustomerService ¶
func NewCustomerService(customerRepo Repository, dvdSvc ProxyService) Service
NewCustomerService init customer's service interface
func NewService ¶
func NewService(customerRepo Repository, logger log.Logger, counter metrics.Counter, histogram metrics.Histogram, dvdSvc ProxyService) Service
NewService return customerService with all expected function
Source Files ¶
Click to show internal directories.
Click to hide internal directories.