controller

package
v0.13.0-alpha.148 Latest Latest
Warning

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

Go to latest
Published: Feb 10, 2025 License: MIT Imports: 12 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type CancelRequest

type CancelRequest struct {
	Lease string `json:"lease"`
}

type CompletedRequest

type CompletedRequest struct {
	Lease string `json:"lease"`
}

type ConsumeRequest

type ConsumeRequest struct {
	Lease string `json:"lease"`
}

type Error

type Error struct {
	Code    string `json:"code"`
	Message string `json:"message"`
}

type FailedRequest

type FailedRequest struct {
	Lease string            `json:"lease"`
	Data  model.MessageAttr `json:"data"`
}

type HeartbeatRequest

type HeartbeatRequest struct {
	Data  model.MessageAttr `json:"data"`
	Lease string            `json:"lease"`
}

type MessageController

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

func NewMessageController

func NewMessageController(messageService *service.MessageService) *MessageController

func (*MessageController) Cancel

func (mc *MessageController) Cancel(req *restful.Request, resp *restful.Response)

func (*MessageController) Complete

func (mc *MessageController) Complete(req *restful.Request, resp *restful.Response)

func (*MessageController) Consume

func (mc *MessageController) Consume(req *restful.Request, resp *restful.Response)

func (*MessageController) Create

func (mc *MessageController) Create(req *restful.Request, resp *restful.Response)

func (*MessageController) Failed

func (mc *MessageController) Failed(req *restful.Request, resp *restful.Response)

func (*MessageController) Get

func (mc *MessageController) Get(req *restful.Request, resp *restful.Response)

func (*MessageController) Heartbeat

func (mc *MessageController) Heartbeat(req *restful.Request, resp *restful.Response)

func (*MessageController) List

func (mc *MessageController) List(req *restful.Request, resp *restful.Response)

func (*MessageController) RegisterRoutes

func (mc *MessageController) RegisterRoutes(ws *restful.WebService)

func (*MessageController) Schedule

func (mc *MessageController) Schedule(ctx context.Context, logger *slog.Logger)

type MessageRequest

type MessageRequest struct {
	Content  string `json:"content"`
	Priority int    `json:"priority"`

	Data model.MessageAttr `json:"data,omitempty"`
}

type MessageResponse

type MessageResponse struct {
	MessageID     int64               `json:"id"`
	Content       string              `json:"content"`
	Priority      int                 `json:"priority"`
	Status        model.MessageStatus `json:"status"`
	Data          model.MessageAttr   `json:"data,omitempty"`
	LastHeartbeat time.Time           `json:"last_heartbeat"`
}

Jump to

Keyboard shortcuts

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