Documentation ¶
Index ¶
Constants ¶
This section is empty.
Variables ¶
View Source
var ErrNotFound = fmt.Errorf("%s", "not found")
ErrNotFound is returned when there is no customer for a given ID.
Functions ¶
This section is empty.
Types ¶
type Health ¶
type Health struct { Service string `json:"service"` Status string `json:"status"` Time string `json:"time"` }
Health describes the health of a service
type Middleware ¶
Middleware decorates a Service.
func InstrumentingSvcMiddleware ¶
func InstrumentingSvcMiddleware(customerCounter metrics.Counter) Middleware
func LoggingMiddleware ¶
func LoggingMiddleware(logger log.Logger) Middleware
LoggingMiddleware logs method calls, parameters, results, and elapsed time.
type Service ¶
type Service interface { Create(context.Context, string, float64) (string, error) GetByName(context.Context, string) (*domain.Customer, error) // GET /tags Health() []Health // GET /health }
Service is the customer service, providing read operations on a customer
func NewCustomerService ¶
func NewCustomerService(db infrastructure.CustomerRepositoryInterface, customerCounter metrics.Counter, logger log.Logger) Service
NewCustomersService returns an implementation of the Service interface,
Click to show internal directories.
Click to hide internal directories.