handler

package
v0.0.0-...-2b84898 Latest Latest
Warning

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

Go to latest
Published: Nov 1, 2024 License: MIT Imports: 22 Imported by: 0

Documentation

Index

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

func (h *Handler) AddProduct(c echo.Context) error

@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

func (h *Handler) Call(c echo.Context) error

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

func (h *Handler) GetCount(c echo.Context) error

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

func (h *Handler) GetProduct(c echo.Context) error

@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

func (h *Handler) Message(c echo.Context) error

@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

func (h *Handler) PostCount(c echo.Context) error

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) Register

func (h *Handler) Register(group *echo.Group)

func (*Handler) SendProduct

func (h *Handler) SendProduct(c echo.Context) error

@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{}

Jump to

Keyboard shortcuts

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