handler

package
v1.0.1 Latest Latest
Warning

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

Go to latest
Published: Apr 1, 2022 License: MIT Imports: 10 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type FetchReq

type FetchReq struct {
	Subject string `json:"subject"`
	ID      string `json:"id"`
}

FetchReq represents fetch request body.

type FetchRes

type FetchRes struct {
	Subject string   `json:"subject"`
	ID      string   `json:"id"`
	Data    []string `json:"data"`
}

FetchRes represents fetch response body.

type Handler

type Handler struct {
	// contains filtered or unexported fields
}

Handler represents broker handler.

func NewHandler

func NewHandler(mq broker.Broker) *Handler

NewHandler creates new Handler.

func (*Handler) Fetch

func (h *Handler) Fetch(ctx echo.Context) error

func (*Handler) Publish

func (h *Handler) Publish(ctx echo.Context) error

func (*Handler) PublishAsync

func (h *Handler) PublishAsync(ctx echo.Context) error

func (*Handler) Subscribe

func (h *Handler) Subscribe(ctx echo.Context) error

type PublishReq

type PublishReq struct {
	Subject string `json:"subject"`
	Data    string `json:"data"`
}

PublishReq represents publish request body.

type SubscribeReq

type SubscribeReq struct {
	Subject string `json:"subject"`
}

SubscribeReq represents subscribe request body.

type SubscribeRes

type SubscribeRes struct {
	Subject string `json:"subject"`
	ID      string `json:"id"`
}

SubscribeRes represents subscribe response body.

Jump to

Keyboard shortcuts

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