Documentation
¶
Index ¶
- Constants
- Variables
- type Client
- type HandleFunc
- type Handler
- type Logger
- type Metrics
- func (m *Metrics) QueueDequeueErrInc(queue string)
- func (m *Metrics) QueueDequeueOkInc(queue string)
- func (m *Metrics) QueueEnqueueErrInc(queue, task string)
- func (m *Metrics) QueueEnqueueOkInc(queue, task string)
- func (m *Metrics) TaskProcessErrInc(queue string, task *taskMessage)
- func (m *Metrics) TaskProcessExpiredInc(queue string, task *taskMessage)
- func (m *Metrics) TaskProcessOkInc(queue string, task *taskMessage)
- type MetricsOption
- type Mux
- type Option
- type Qsync
- type Server
- type ServerOption
- type Task
- type TaskInfo
- type TaskOption
Constants ¶
View Source
const ( Critical = "critical" Default = "default" Lower = "lower" )
Variables ¶
View Source
var ( ErrHandlerOverlap = errors.New("handler overlap") ErrHandlerNotFound = errors.New("handler not found") )
View Source
var ( ErrMuxIsEmpty = errors.New("mux is empty") ErrMatrixIsEmpty = errors.New("matrix is empty") )
Functions ¶
This section is empty.
Types ¶
type Metrics ¶ added in v2.0.5
type Metrics struct {
// contains filtered or unexported fields
}
func NewMetrics ¶ added in v2.0.5
func NewMetrics(enabled bool, opts ...MetricsOption) *Metrics
func (*Metrics) QueueDequeueErrInc ¶ added in v2.0.5
func (*Metrics) QueueDequeueOkInc ¶ added in v2.0.5
func (*Metrics) QueueEnqueueErrInc ¶ added in v2.0.5
func (*Metrics) QueueEnqueueOkInc ¶ added in v2.0.5
func (*Metrics) TaskProcessErrInc ¶ added in v2.0.5
func (*Metrics) TaskProcessExpiredInc ¶ added in v2.0.5
func (*Metrics) TaskProcessOkInc ¶ added in v2.0.5
type MetricsOption ¶ added in v2.0.5
type MetricsOption func(*Metrics)
func WithEnabled ¶ added in v2.0.5
func WithEnabled(enabled bool) MetricsOption
func WithNamespace ¶ added in v2.0.5
func WithNamespace(namespace string) MetricsOption
func WithRegister ¶ added in v2.0.7
func WithRegister(register prometheus.Registerer) MetricsOption
type Mux ¶
type Mux struct {
// contains filtered or unexported fields
}
func (*Mux) HandleFunc ¶
func (m *Mux) HandleFunc(pattern string, handler HandleFunc) error
type Option ¶
func WithLogger ¶
func WithMetrics ¶ added in v2.0.5
func WithMetrics(opts ...MetricsOption) Option
func WithPrefix ¶
type ServerOption ¶
type ServerOption func(s *server) error
func WithContext ¶
func WithContext(fn func() context.Context) ServerOption
func WithErrorHandler ¶
func WithErrorHandler(fn func(error, *TaskInfo)) ServerOption
func WithMatrix ¶
func WithMatrix(matrix map[string]int) ServerOption
func WithServerLogger ¶
func WithServerLogger(logger *slog.Logger) ServerOption
func WithWait ¶ added in v2.0.9
func WithWait(wait time.Duration) ServerOption
type TaskOption ¶
type TaskOption func(*Task)
func WithDeadline ¶
func WithDeadline(deadline time.Time) TaskOption
func WithDelay ¶
func WithDelay(delay time.Duration) TaskOption
func WithId ¶
func WithId(id string) TaskOption
func WithProcessAt ¶
func WithProcessAt(processAt time.Time) TaskOption
func WithRetry ¶
func WithRetry(retry int) TaskOption
func WithRetryDelay ¶
func WithRetryDelay(delay time.Duration) TaskOption
Source Files
¶
Click to show internal directories.
Click to hide internal directories.