handlers

package
v1.2.1 Latest Latest
Warning

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

Go to latest
Published: Feb 1, 2026 License: MIT Imports: 16 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type BaseHandler

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

BaseHandler provides common functionality for all handlers

type DashboardHandler

type DashboardHandler struct {
	BaseHandler
}

DashboardHandler handles dashboard-related requests

func NewDashboardHandler

func NewDashboardHandler(templates *template.Template, client *client.ChronoQueueClient, logger *log.Logger) *DashboardHandler

NewDashboardHandler creates a new dashboard handler

func (*DashboardHandler) Index

Index renders the main dashboard page

func (*DashboardHandler) Metrics

func (h *DashboardHandler) Metrics(w http.ResponseWriter, r *http.Request)

Metrics returns real-time metrics for HTMX polling

type DashboardMetrics

type DashboardMetrics struct {
	TotalQueues    int
	TotalPending   int64
	TotalRunning   int64
	TotalCompleted int64
	TotalDLQ       int64
	ProblemQueues  []ProblemQueue
	Timestamp      time.Time
}

DashboardMetrics holds aggregated system metrics

type MessageDisplay

type MessageDisplay struct {
	Id           string
	ShortId      string // Shortened ID for display (first 12 chars)
	State        string
	Priority     int64
	AttemptCount int32
	CreatedAt    time.Time
}

MessageDisplay represents a simplified message for template rendering

type ProblemQueue

type ProblemQueue struct {
	Name     string
	Message  string
	Severity string // "high", "warning"
	Link     string
}

ProblemQueue represents a queue that needs attention

type QueueDisplay

type QueueDisplay struct {
	Name     string
	Metadata interface{}
	IsDLQ    bool
}

QueueDisplay represents a queue with DLQ flag for template rendering

type QueuesHandler

type QueuesHandler struct {
	BaseHandler
}

QueuesHandler handles queue-related requests

func NewQueuesHandler

func NewQueuesHandler(templates *template.Template, client *client.ChronoQueueClient, logger *log.Logger) *QueuesHandler

NewQueuesHandler creates a new queues handler

func (*QueuesHandler) Detail

func (h *QueuesHandler) Detail(w http.ResponseWriter, r *http.Request)

Detail renders the queue detail page with messages

func (*QueuesHandler) List

func (h *QueuesHandler) List(w http.ResponseWriter, r *http.Request)

List renders the queue listing page with optional filtering

func (*QueuesHandler) MessageDetail

func (h *QueuesHandler) MessageDetail(w http.ResponseWriter, r *http.Request)

MessageDetail returns detailed information about a specific message (for modal display)

func (*QueuesHandler) Purge

func (h *QueuesHandler) Purge(w http.ResponseWriter, r *http.Request)

Purge permanently deletes all messages from a DLQ

func (*QueuesHandler) RequeueAll

func (h *QueuesHandler) RequeueAll(w http.ResponseWriter, r *http.Request)

RequeueAll requeues all messages from a DLQ back to the original queue

func (*QueuesHandler) Stats

func (h *QueuesHandler) Stats(w http.ResponseWriter, r *http.Request)

Stats returns queue statistics for HTMX updates

type SchedulesHandler

type SchedulesHandler struct {
	BaseHandler
}

SchedulesHandler handles schedule-related requests

func NewSchedulesHandler

func NewSchedulesHandler(templates *template.Template, client *client.ChronoQueueClient, logger *log.Logger) *SchedulesHandler

NewSchedulesHandler creates a new schedules handler

func (*SchedulesHandler) Create

func (h *SchedulesHandler) Create(w http.ResponseWriter, r *http.Request)

Create handles schedule creation (HTMX POST)

func (*SchedulesHandler) Delete

func (h *SchedulesHandler) Delete(w http.ResponseWriter, r *http.Request)

Delete handles schedule deletion (HTMX DELETE)

func (*SchedulesHandler) Detail

func (h *SchedulesHandler) Detail(w http.ResponseWriter, r *http.Request)

Detail renders the schedule detail/edit page

func (*SchedulesHandler) List

List renders the schedule listing page

func (*SchedulesHandler) New

New renders the create schedule form

func (*SchedulesHandler) Toggle

func (h *SchedulesHandler) Toggle(w http.ResponseWriter, r *http.Request)

Toggle handles pause/resume (HTMX POST)

func (*SchedulesHandler) Update

func (h *SchedulesHandler) Update(w http.ResponseWriter, r *http.Request)

Update handles schedule updates (HTMX POST)

Jump to

Keyboard shortcuts

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