Documentation
¶
Index ¶
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
This section is empty.
Types ¶
type ConsumerService ¶
type ConsumerService struct {
// contains filtered or unexported fields
}
func NewConsumerService ¶
func NewConsumerService(repo data.Repository, nc Subscriber, logger *log.Logger) *ConsumerService
func (ConsumerService) GetCoffees ¶
func (c ConsumerService) GetCoffees(msg Message)
func (ConsumerService) RegisterConsumer ¶
func (c ConsumerService) RegisterConsumer(topic string, consumer Consumer)
type HealthService ¶
type HealthService struct {
// contains filtered or unexported fields
}
HealthService is a HTTP Consumer for health checking
func NewHealth ¶
func NewHealth(l *log.Logger) *HealthService
NewHealth creates a new Health handler
func (*HealthService) ServeHTTP ¶
func (h *HealthService) ServeHTTP(w http.ResponseWriter, r *http.Request)
ServeHTTP implements the handler interface
type ProductService ¶
type ProductService struct {
// contains filtered or unexported fields
}
ProductService defines the operations the service supports
func NewCoffeeService ¶
func NewCoffeeService(repo data.Repository, nc events.Publisher, logger *log.Logger) *ProductService
NewCoffeeService creates a new instance of the coffee service
func (*ProductService) Add ¶
func (p *ProductService) Add(w http.ResponseWriter, r *http.Request)
Add adds a new coffee from the json body
func (*ProductService) Get ¶
func (p *ProductService) Get(w http.ResponseWriter, r *http.Request)
Get retrieves a coffee by id
func (*ProductService) List ¶
func (p *ProductService) List(w http.ResponseWriter, r *http.Request)
List retrieves a list of coffees
func (*ProductService) RegisterRoutes ¶
func (p *ProductService) RegisterRoutes(r *mux.Router)
type Subscriber ¶
Click to show internal directories.
Click to hide internal directories.