redisadmin

package
v1.4.2 Latest Latest
Warning

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

Go to latest
Published: Nov 11, 2026 License: AGPL-3.0 Imports: 10 Imported by: 0

Documentation

Index

Constants

View Source
const DefaultPageSize = 10

Variables

View Source
var Messages = map[string]string{
	"queue_cleared":   "Queue cleared.",
	"system_error":    "Something went wrong. Check the server log.",
	"empty_or_error":  "The queue is empty or could not be read.",
	"invalid_item":    "That queue item could not be read.",
	"send_failed":     "Sending failed. The task was moved to the dead letter queue.",
	"processed_one":   "One task sent.",
	"requeue_failed":  "Could not requeue the task.",
	"dlq_empty":       "The dead letter queue is empty.",
	"requeued_one":    "One task requeued.",
	"missing_item":    "No item was given.",
	"item_deleted":    "Item deleted.",
	"moved_to_dlq":    "Moved to the dead letter queue.",
	"requeued_item":   "Item requeued.",
	"resend_failed":   "Could not queue the email again.",
	"resend_queued":   "Email queued again.",
	"redis_not_ready": "Redis is not connected.",
}

Functions

func AtoiDefault

func AtoiDefault(s string, def int) int

func ClampPage

func ClampPage(p int) int

func ClearQueues

func ClearQueues(queues ...string) error

func DeleteItem

func DeleteItem(queue, raw string) error

func EmailTasks

func EmailTasks(queue string, page, pageSize int) ([]redis.EmailTask, error)

func ErrorRecords

func ErrorRecords(page, pageSize int) ([]redis.EmailErrorRecord, error)

func Inspect

func Inspect(queue string, limit int64) ([]string, error)

func ListLen

func ListLen(queue string) (int64, error)

func LogLen

func LogLen(name string) (int64, error)

func MoveItem

func MoveItem(from, to, raw string) error

func Pattern

func Pattern(prefixless string) string

func ResendTask

func ResendTask(rawTask string) error

func RetryTasks

func RetryTasks(page, pageSize int) ([]redis.EmailTask, error)

func RunOne

func RunOne(send func(redis.EmailTask) error) (bool, error)

func SentRecords

func SentRecords(page, pageSize int) ([]redis.EmailSentRecord, error)

func SetLen

func SetLen(queue string) (int64, error)

Types

type Handler added in v1.4.0

type Handler struct {
	Path   string
	Render func(w http.ResponseWriter, r *http.Request, ov *Overview)
	Flash  func(w http.ResponseWriter, r *http.Request, kind, key string)
	Send   func(redis.EmailTask) error
	Extra  func(w http.ResponseWriter, r *http.Request, action string) bool
}

func (*Handler) Action added in v1.4.0

func (h *Handler) Action(w http.ResponseWriter, r *http.Request)

func (*Handler) Keys added in v1.4.0

func (h *Handler) Keys(w http.ResponseWriter, r *http.Request)

func (*Handler) Overview added in v1.4.0

func (h *Handler) Overview(w http.ResponseWriter, r *http.Request)

type KeySummary

type KeySummary struct {
	Name string
	Type string
	Size int64
}

func KeysPage

func KeysPage(pattern string, page, pageSize int) ([]KeySummary, int, error)

func ScanKeys

func ScanKeys(pattern string, startCursor uint64, want int) ([]KeySummary, uint64, error)

func ScanKeysBounded added in v1.4.0

func ScanKeysBounded(pattern string, startCursor uint64, want int) (out []KeySummary, next uint64, scanned int, err error)

func Summary

func Summary(key string) KeySummary

type LoadError added in v1.4.0

type LoadError struct {
	Part string
	Err  string
}

type Overview added in v1.4.0

type Overview struct {
	EmailQueueSize      int64
	DeadLetterQueueSize int64
	PageSize            int

	EmailTotal int64
	EmailPage  int
	EmailPages int
	EmailPrev  int
	EmailNext  int
	EmailTasks []redis.EmailTask

	DeadTotal int64
	DeadPage  int
	DeadPages int
	DeadPrev  int
	DeadNext  int
	DeadTasks []redis.EmailTask

	SentTotal   int64
	SentPage    int
	SentPages   int
	SentPrev    int
	SentNext    int
	SentRecords []redis.EmailSentRecord

	EmailErrTotal   int64
	EmailErrPage    int
	EmailErrPages   int
	EmailErrPrev    int
	EmailErrNext    int
	EmailErrRecords []redis.EmailErrorRecord

	KeyPage int
	Errors  []LoadError
}

func (Overview) FormatErrors added in v1.4.0

func (o Overview) FormatErrors(tmpl string) []string

type Pager

type Pager struct {
	Total int64
	Page  int
	Pages int
	Prev  int
	Next  int
}

func NewPager

func NewPager(total int64, page, pageSize int) Pager

type Section added in v1.4.0

type Section struct {
	Total int64
	Page  int
	Pages int
	Prev  int
	Next  int
}

Jump to

Keyboard shortcuts

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