handlers

package
v1.0.14 Latest Latest
Warning

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

Go to latest
Published: Sep 27, 2023 License: MIT Imports: 22 Imported by: 0

Documentation

Index

Constants

View Source
const (
	ThrottleActionConsume = "consume"
	ThrottleActionProduce = "produce"
)

Variables

View Source
var (
	DefaultTTL     string
	DefaultDelay   string
	DefaultTries   string
	DefaultTTR     string
	DefaultTimeout string
)

Functions

func AddLimiter

func AddLimiter(c *gin.Context)

POST /token/:namespace/:token/limit

func CheckPoolExists added in v1.0.4

func CheckPoolExists(c *gin.Context)

func CollectMetrics

func CollectMetrics(c *gin.Context)

func Consume

func Consume(c *gin.Context)

GET /:namespace/:queue[,:queue]* @query:

  • ttr: uint32
  • timeout: uint32
  • count: uint32

NOTE: according to RFC3986, the URL path part can contain comma(",") , so I decide to use "," as the separator of queue names

func Delete

func Delete(c *gin.Context)

DELETE /:namespace/:queue/job/:job_id

func DeleteDeadLetter

func DeleteDeadLetter(c *gin.Context)

DELETE /:namespace/:queue/deadletter Delete job(s) in the deadletter

func DeleteLimiter

func DeleteLimiter(c *gin.Context)

DELETE /token/:namespace/:token/limit

func DeleteToken

func DeleteToken(c *gin.Context)

DELETE /token/:namespace/:token

func DestroyQueue

func DestroyQueue(c *gin.Context)

func EngineMetaInfo

func EngineMetaInfo(c *gin.Context)

GET /info?pool= List all namespaces and queues

func GetAccessLogStatus

func GetAccessLogStatus(c *gin.Context)

GetAccessLogStatus return whether the accesslog was enabled or not GET /accesslog

func GetDeadLetterSize

func GetDeadLetterSize(c *gin.Context)

GetDeadLetterSize return the size of dead letter GET /:namespace/:queue/deadletter/size

func GetHTTPLogger

func GetHTTPLogger(c *gin.Context) *logrus.Entry

func GetLimiter

func GetLimiter(c *gin.Context)

GET /token/:namespace/:token/limit

func ListLimiters

func ListLimiters(c *gin.Context)

GET /limiters

func ListPools

func ListPools(c *gin.Context)

GET /pools/

func ListTokens

func ListTokens(c *gin.Context)

GET /token/:namespace

func NewToken

func NewToken(c *gin.Context)

POST /token/:namespace

func PProf

func PProf(c *gin.Context)

func PeekDeadLetter

func PeekDeadLetter(c *gin.Context)

GET /:namespace/:queue/deadletter Get the first job in the deadletter

func PeekJob

func PeekJob(c *gin.Context)

GET /:namespace/:queue/job/:job_id

func PeekQueue

func PeekQueue(c *gin.Context)

GET /:namespace/:queue/peek

func PrometheusMetrics

func PrometheusMetrics(c *gin.Context)

GET /metrics

func Publish

func Publish(c *gin.Context)

PUT /:namespace/:queue @query:

  • delay: uint32
  • ttl: uint32
  • tries: uint16

func PublishBulk added in v1.0.3

func PublishBulk(c *gin.Context)

PUT /:namespace/:queue/bulk @query:

  • delay: uint32
  • ttl: uint32
  • tries: uint16

func RespawnDeadLetter

func RespawnDeadLetter(c *gin.Context)

PUT /:namespace/:queue/deadletter Respawn job(s) in the deadletter

func SetLimiter

func SetLimiter(c *gin.Context)

PUT /token/:namespace/:token/limit

func Setup

func Setup(l *logrus.Logger)

func SetupParamDefaults

func SetupParamDefaults(conf *config.Config)

func SetupQueueEngine

func SetupQueueEngine(c *gin.Context)

func Size

func Size(c *gin.Context)

GET /:namespace/:queue/size

func Throttle

func Throttle(action string) gin.HandlerFunc

func UpdateAccessLogStatus

func UpdateAccessLogStatus(c *gin.Context)

UpdateAccessLogStatus update the accesslog status POST /accesslog

func ValidateMultiConsume

func ValidateMultiConsume(c *gin.Context)

func ValidateParams

func ValidateParams(c *gin.Context)

Validate namespace and queue names don't contain any illegal characters

func ValidateToken

func ValidateToken(c *gin.Context)

func Version

func Version(c *gin.Context)

GET /version

Types

type PerformanceMetrics

type PerformanceMetrics struct {
	Latencies  *prometheus.HistogramVec
	HTTPCodes  *prometheus.CounterVec
	RateLimits *prometheus.CounterVec
}

Jump to

Keyboard shortcuts

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