Documentation
¶
Index ¶
- type AckInput
- type AckOutput
- type AckOutputBody
- type BackupInput
- type CreateQueueInput
- type CreateQueueInputBody
- type CreateQueueOutput
- type CreateQueueOutputBody
- type DeleteInput
- type DeleteOutput
- type DeleteQueueInput
- type DeleteQueueOutput
- type DeleteQueueOutputBody
- type DequeueInput
- type DequeueOutput
- type DequeueOutputBody
- type EnqueueInput
- type EnqueueInputBody
- type EnqueueOutput
- type EnqueueOutputBody
- type GenerateIdInput
- type GenerateIdInputBody
- type GenerateIdOutput
- type GenerateIdOutputBody
- type GetInput
- type GetOutput
- type GetOutputBody
- type Handler
- func (h *Handler) Ack(ctx context.Context, input *AckInput) (*AckOutput, error)
- func (h *Handler) Backup(ctx context.Context, input *BackupInput) (*huma.StreamResponse, error)
- func (h *Handler) ConfigureMiddleware(router *fiber.App)
- func (h *Handler) CreateQueue(ctx context.Context, input *CreateQueueInput) (*CreateQueueOutput, error)
- func (h *Handler) Delete(ctx context.Context, input *DeleteInput) (*DeleteOutput, error)
- func (h *Handler) DeleteQueue(ctx context.Context, input *DeleteQueueInput) (*DeleteQueueOutput, error)
- func (h *Handler) Dequeue(ctx context.Context, input *DequeueInput) (*DequeueOutput, error)
- func (h *Handler) Enqueue(ctx context.Context, input *EnqueueInput) (*EnqueueOutput, error)
- func (h *Handler) GenerateID(ctx context.Context, input *GenerateIdInput) (*GenerateIdOutput, error)
- func (h *Handler) Get(ctx context.Context, input *GetInput) (*GetOutput, error)
- func (h *Handler) Join(ctx context.Context, input *JoinInput) (*JoinOutput, error)
- func (h *Handler) Nack(ctx context.Context, input *NackInput) (*NackOutput, error)
- func (h *Handler) QueueInfo(ctx context.Context, input *QueueInfoInput) (*QueueInfoOutput, error)
- func (h *Handler) Queues(ctx context.Context, input *QueuesInput) (*QueuesOutput, error)
- func (h *Handler) RegisterRoutes(api huma.API)
- func (h *Handler) Restore(ctx context.Context, input *RestoreInput) (*RestoreOutput, error)
- func (h *Handler) UpdatePriority(ctx context.Context, input *UpdatePriorityInput) (*UpdatePriorityOutput, error)
- type JoinInput
- type JoinOutput
- type JoinOutputBody
- type NackInput
- type NackInputBody
- type NackOutput
- type NackOutputBody
- type Node
- type QueueInfoInput
- type QueueInfoOutput
- type QueueInfoOutputBody
- type QueueOutput
- type QueueSettings
- type QueuesInput
- type QueuesOutput
- type QueuesOutputBody
- type RestoreInput
- type RestoreOutput
- type RestoreOutputBody
- type Service
- type UpdatePriorityInput
- type UpdatePriorityInputBody
- type UpdatePriorityOutput
- type UpdatePriorityOutputBody
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
This section is empty.
Types ¶
type AckOutput ¶
type AckOutput struct {
Status int
Body AckOutputBody
}
type AckOutputBody ¶
type BackupInput ¶ added in v0.3.4
type BackupInput struct {
Body struct {
Since uint64 `json:"since" example:"0" doc:"Minimum version of the log to include in the backup"`
}
}
type CreateQueueInput ¶
type CreateQueueInput struct {
Body CreateQueueInputBody
}
type CreateQueueInputBody ¶
type CreateQueueInputBody struct {
Name string `json:"name" maxLength:"1024" example:"user_indexing_queue" doc:"Name of the queue"`
Type string `json:"type" enum:"delayed,fair" example:"delayed" doc:"Type of the queue"`
Settings QueueSettings `json:"settings" doc:"Configuration of the queue"`
}
type CreateQueueOutput ¶
type CreateQueueOutput struct {
Status int
Body CreateQueueOutputBody
}
type CreateQueueOutputBody ¶
type CreateQueueOutputBody struct {
Status string `json:"status" example:"CREATED" doc:"Status of the create operation"`
Name string `json:"name" maxLength:"1024" example:"user_indexing_queue" doc:"Name of the queue"`
Type string `json:"type" enum:"delayed,fair" example:"delayed" doc:"Type of the queue"`
Settings QueueSettings `json:"settings" doc:"Configuration of the queue"`
}
type DeleteInput ¶ added in v0.3.0
type DeleteOutput ¶ added in v0.3.0
type DeleteOutput struct {
Status int
}
type DeleteQueueInput ¶
type DeleteQueueInput struct {
QueueName string `path:"queue_name" maxLength:"1024" example:"user_indexing_queue" doc:"Name of the queue"`
}
type DeleteQueueOutput ¶
type DeleteQueueOutput struct {
Status int
Body DeleteQueueOutputBody
}
type DeleteQueueOutputBody ¶
type DeleteQueueOutputBody struct {
Status string `json:"status" example:"DELETED" doc:"Status of the delete operation"`
}
type DequeueInput ¶
type DequeueOutput ¶
type DequeueOutput struct {
Status int
Body DequeueOutputBody
}
type DequeueOutputBody ¶
type DequeueOutputBody struct {
Status string `json:"status" example:"DEQUEUED" doc:"Status of the dequeue operation"`
ID string `json:"id" doc:"ID of the message"`
Group string `json:"group,omitempty" default:"default" example:"customer-1" doc:"Group of the message"`
Priority int64 `json:"priority" minimum:"0" example:"60" doc:"Priority of the message"`
Content string `json:"content" example:"{\"user_id\": 1}" doc:"Content of the message"`
Metadata map[string]string `json:"metadata,omitempty" example:"{\"retry\": \"0\"}" doc:"Metadata of the message"`
}
type EnqueueInput ¶
type EnqueueInput struct {
QueueName string `path:"queue_name" maxLength:"1024" example:"user_indexing_queue" doc:"Name of the queue"`
Body EnqueueInputBody
}
type EnqueueInputBody ¶
type EnqueueInputBody struct {
ID string `json:"id,omitempty" doc:"ID of the message"`
Group string `json:"group,omitempty" default:"default" example:"customer-1" doc:"Group of the message"`
Priority int64 `json:"priority" minimum:"0" example:"60" doc:"Priority of the message"`
Content string `json:"content" example:"{\"user_id\": 1}" doc:"Content of the message"`
Metadata map[string]string `json:"metadata,omitempty" example:"{\"retry\": \"0\"}" doc:"Metadata of the message"`
}
type EnqueueOutput ¶
type EnqueueOutput struct {
Status int
Body EnqueueOutputBody
}
type EnqueueOutputBody ¶
type EnqueueOutputBody struct {
Status string `json:"status" example:"ENQUEUED" doc:"Status of the enqueue operation"`
ID string `json:"id" doc:"ID of the message"`
Group string `json:"group,omitempty" default:"default" example:"customer-1" doc:"Group of the message"`
Priority int64 `json:"priority" minimum:"0" example:"60" doc:"Priority of the message"`
Content string `json:"content" example:"{\"user_id\": 1}" doc:"Content of the message"`
Metadata map[string]string `json:"metadata,omitempty" example:"{\"retry\": \"0\"}" doc:"Metadata of the message"`
}
type GenerateIdInput ¶ added in v0.9.4
type GenerateIdInput struct {
Body GenerateIdInputBody
}
type GenerateIdInputBody ¶ added in v0.9.4
type GenerateIdInputBody struct {
Number int `json:"number" minimum:"1" maximum:"1000" example:"1" doc:"Number of IDs to generate"`
}
type GenerateIdOutput ¶ added in v0.9.4
type GenerateIdOutput struct {
Status int
Body GenerateIdOutputBody
}
type GenerateIdOutputBody ¶ added in v0.9.4
type GenerateIdOutputBody struct {
IDs []string `json:"ids" doc:"List of generated IDs"`
}
type GetOutput ¶ added in v0.3.0
type GetOutput struct {
Status int
Body GetOutputBody
}
type GetOutputBody ¶ added in v0.3.0
type GetOutputBody struct {
Status string `json:"status" example:"DEQUEUED" doc:"Status of the dequeue operation"`
ID string `json:"id" doc:"ID of the message"`
Group string `json:"group,omitempty" default:"default" example:"customer-1" doc:"Group of the message"`
Priority int64 `json:"priority" minimum:"0" example:"60" doc:"Priority of the message"`
Content string `json:"content" example:"{\"user_id\": 1}" doc:"Content of the message"`
Metadata map[string]string `json:"metadata,omitempty" example:"{\"retry\": \"0\"}" doc:"Metadata of the message"`
}
type Handler ¶
type Handler struct {
// contains filtered or unexported fields
}
func (*Handler) Backup ¶ added in v0.3.4
func (h *Handler) Backup(ctx context.Context, input *BackupInput) (*huma.StreamResponse, error)
func (*Handler) ConfigureMiddleware ¶
func (*Handler) CreateQueue ¶
func (h *Handler) CreateQueue(ctx context.Context, input *CreateQueueInput) (*CreateQueueOutput, error)
func (*Handler) Delete ¶ added in v0.3.0
func (h *Handler) Delete(ctx context.Context, input *DeleteInput) (*DeleteOutput, error)
func (*Handler) DeleteQueue ¶
func (h *Handler) DeleteQueue(ctx context.Context, input *DeleteQueueInput) (*DeleteQueueOutput, error)
func (*Handler) Dequeue ¶
func (h *Handler) Dequeue(ctx context.Context, input *DequeueInput) (*DequeueOutput, error)
func (*Handler) Enqueue ¶
func (h *Handler) Enqueue(ctx context.Context, input *EnqueueInput) (*EnqueueOutput, error)
func (*Handler) GenerateID ¶ added in v0.9.4
func (h *Handler) GenerateID(ctx context.Context, input *GenerateIdInput) (*GenerateIdOutput, error)
func (*Handler) QueueInfo ¶ added in v0.2.0
func (h *Handler) QueueInfo(ctx context.Context, input *QueueInfoInput) (*QueueInfoOutput, error)
func (*Handler) Queues ¶ added in v0.2.0
func (h *Handler) Queues(ctx context.Context, input *QueuesInput) (*QueuesOutput, error)
func (*Handler) RegisterRoutes ¶
func (*Handler) Restore ¶ added in v0.3.4
func (h *Handler) Restore(ctx context.Context, input *RestoreInput) (*RestoreOutput, error)
func (*Handler) UpdatePriority ¶
func (h *Handler) UpdatePriority(ctx context.Context, input *UpdatePriorityInput) (*UpdatePriorityOutput, error)
type JoinOutput ¶ added in v0.1.11
type JoinOutput struct {
Body JoinOutputBody
}
type JoinOutputBody ¶ added in v0.3.10
type NackInput ¶ added in v0.2.4
type NackInput struct {
QueueName string `path:"queue_name" maxLength:"1024" example:"user_indexing_queue" doc:"Name of the queue"`
ID uint64 `path:"id" example:"123" doc:"ID of the message"`
Body NackInputBody
}
type NackInputBody ¶ added in v0.3.0
type NackOutput ¶ added in v0.2.4
type NackOutput struct {
Status int
Body NackOutputBody
}
type NackOutputBody ¶ added in v0.2.4
type NackOutputBody struct {
Status string `json:"status" example:"UNACKNOWLEDGED" doc:"Status of the dequeue operation"`
ID string `json:"id" doc:"ID of the message"`
Priority int64 `json:"priority" minimum:"0" example:"60" doc:"Priority of the message"`
Metadata map[string]string `json:"metadata,omitempty" example:"{\"retry\": \"0\"}" doc:"Metadata of the message"`
}
type Node ¶
type Node interface {
Join(nodeID string, addr string) error
PrometheusRegistry() prometheus.Registerer
IsLeader() bool
GenerateID() uint64
CreateQueue(queueType, queueName string, settings entity.QueueSettings) error
DeleteQueue(queueName string) error
GetQueues() []*queue.QueueInfo
GetQueueInfo(queueName string) (*queue.QueueInfo, error)
Enqueue(
queueName string,
id uint64,
group string,
priority int64,
content string,
metadata map[string]string,
) (*entity.Message, error)
Dequeue(QueueName string, ack bool) (*entity.Message, error)
Get(QueueName string, id uint64) (*entity.Message, error)
Delete(QueueName string, id uint64) error
Ack(QueueName string, id uint64) error
Nack(QueueName string, id uint64, priority int64, metadata map[string]string) error
UpdatePriority(queueName string, id uint64, priority int64) error
Backup(w io.Writer, since uint64) (uint64, error)
Restore(r io.Reader, maxPendingWrites int) error
}
type QueueInfoInput ¶ added in v0.2.0
type QueueInfoInput struct {
QueueName string `path:"queue_name" maxLength:"1024" example:"user_indexing_queue" doc:"Name of the queue"`
}
type QueueInfoOutput ¶ added in v0.2.0
type QueueInfoOutput struct {
Status int
Body QueueInfoOutputBody
}
type QueueInfoOutputBody ¶ added in v0.2.0
type QueueInfoOutputBody struct {
Name string `json:"name" maxLength:"1024" example:"user_indexing_queue" doc:"Name of the queue"`
Type string `json:"type" enum:"delayed,fair" example:"delayed" doc:"Type of the queue"`
Settings QueueSettings `json:"settings" doc:"Configuration of the queue"`
EnqueueRPS float64 `json:"enqueue_rps" doc:"Rate of enqueued messages per second"`
DequeueRPS float64 `json:"dequeue_rps" doc:"Rate of dequeued messages per second"`
AckRPS float64 `json:"ack_rps" doc:"Rate of acknowledged messages per second"`
NackRPS float64 `json:"nack_rps" doc:"Rate of unacknowledged messages per second"`
Ready int64 `json:"ready" doc:"Number of ready messages"`
Unacked int64 `json:"unacked" doc:"Number of unacknowledged messages"`
Total int64 `json:"total" doc:"Total number of messages"`
}
type QueueOutput ¶ added in v0.2.0
type QueueOutput struct {
Name string `json:"name" maxLength:"1024" example:"user_indexing_queue" doc:"Name of the queue"`
Type string `json:"type" enum:"delayed,fair" example:"delayed" doc:"Type of the queue"`
Settings QueueSettings `json:"settings" doc:"Configuration of the queue"`
EnqueueRPS float64 `json:"enqueue_rps" doc:"Rate of enqueued messages per second"`
DequeueRPS float64 `json:"dequeue_rps" doc:"Rate of dequeued messages per second"`
AckRPS float64 `json:"ack_rps" doc:"Rate of acknowledged messages per second"`
NackRPS float64 `json:"nack_rps" doc:"Rate of unacknowledged messages per second"`
Ready int64 `json:"ready" doc:"Number of ready messages"`
Unacked int64 `json:"unacked" doc:"Number of unacknowledged messages"`
Total int64 `json:"total" doc:"Total number of messages"`
}
type QueueSettings ¶ added in v0.6.0
type QueuesInput ¶ added in v0.2.0
type QueuesInput struct {
}
type QueuesOutput ¶ added in v0.2.0
type QueuesOutput struct {
Status int
Body QueuesOutputBody
}
type QueuesOutputBody ¶ added in v0.2.0
type QueuesOutputBody struct {
Queues []QueueOutput `json:"queues"`
}
type RestoreInput ¶ added in v0.3.4
type RestoreInput struct {
RawBody huma.MultipartFormFiles[struct {
File huma.FormFile `form:"file" contentType:"application/octet-stream" required:"true"`
}]
}
type RestoreOutput ¶ added in v0.3.4
type RestoreOutput struct {
Status int
Body RestoreOutputBody
}
type RestoreOutputBody ¶ added in v0.3.10
type RestoreOutputBody struct {
Status string `json:"status" example:"SUCCEDED" doc:"Status of the restore operation"`
}
type Service ¶
type Service struct {
// contains filtered or unexported fields
}
Service provides HTTP service.
type UpdatePriorityInput ¶
type UpdatePriorityInput struct {
QueueName string `path:"queue_name" maxLength:"1024" example:"user_indexing_queue" doc:"Name of the queue"`
ID uint64 `path:"id" example:"123" doc:"ID of the message"`
Body UpdatePriorityInputBody
}
type UpdatePriorityInputBody ¶
type UpdatePriorityInputBody struct {
Priority int64 `json:"priority" minimum:"0" example:"60" doc:"Priority of the message"`
}
type UpdatePriorityOutput ¶
type UpdatePriorityOutput struct {
Status int
Body UpdatePriorityOutputBody
}
Click to show internal directories.
Click to hide internal directories.