Documentation
¶
Index ¶
- type Handler
- func (h *Handler) AddProduct(c echo.Context) error
- func (h *Handler) Call(c echo.Context) error
- func (h *Handler) GetCount(c echo.Context) error
- func (h *Handler) GetProduct(c echo.Context) error
- func (h *Handler) Message(c echo.Context) error
- func (h *Handler) PostCount(c echo.Context) error
- func (h *Handler) Register(group *echo.Group)
- func (h *Handler) SendProduct(c echo.Context) error
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
This section is empty.
Types ¶
type Handler ¶
type Handler struct { Counter *hold.Counter Clients map[string]*klient.Client KafkaProducer *wkafka.Producer[*model.Product] KafkaTracer *kotel.Tracer DB *dbhandler.Handler }
func (*Handler) AddProduct ¶
@Summary Add new product @Description Add new product @Tags products @Accept application/json @Produce application/json @Param product body model.Product true "Product to record" @Router /products [POST] @Success 200 {object} model.Message{}
func (*Handler) Call ¶
Call
@Summary Call API @Description Call an api with name @Tags call @Produce application/json @Accept application/json @Param data body model.Service true "message" @Param service path string true "service name" @Router /call/{service} [POST] @Success 200 {object} model.Message{} @Failure 400 {object} model.Message{}
func (*Handler) GetCount ¶
GetCount
@Summary Get Count @Description Get Count @Produce json @Router /count [get] @Security ApiKeyAuth @Success 200 {object} model.Message{} @Failure 400 {object} model.Message{}
func (*Handler) GetProduct ¶
@Summary Get product @Description Get product with name @Tags products @Produce application/json @Param name path string true "Product name" @Router /products/{name} [GET] @Success 200 {object} model.Message{}
func (*Handler) Message ¶
@Summary Message to return @Description Message ping/pong @Tags call @Accept application/json @Produce application/json @Param data body model.Service true "message" @Router /message [POST] @Success 200 {object} model.Message{} @Failure 400 {object} model.Message{}
func (*Handler) PostCount ¶
PostCount
@Summary Add new count @Description Add new count @Produce json @Router /count [post] @Security ApiKeyAuth @Param count query int false "Count Value" @Success 200 {object} model.Message{} @Failure 400 {object} model.Message{}
func (*Handler) SendProduct ¶
@Summary Product to record kafka @Tags products @Description Send product to kafka @Accept application/json @Produce application/json @Param name path string true "Product name" @Router /products-send/{name} [POST] @Success 200 {object} model.Message{}