Documentation
¶
Index ¶
- type Authorizer
- type DequeueParams
- type DequeueResult
- type Handler
- type LeaseBatchResult
- type OpError
- type Server
- func (s *Server) AckBatch(route string, leaseIDs []string) (LeaseBatchResult, *OpError)
- func (s *Server) AckSingle(route string, leaseID string) *OpError
- func (s *Server) Dequeue(route string, params DequeueParams) (DequeueResult, *OpError)
- func (s *Server) Extend(route string, leaseID string, extendBy time.Duration) *OpError
- func (s *Server) NackBatch(route string, leaseIDs []string, dead bool, reason string, delay time.Duration) (LeaseBatchResult, *OpError)
- func (s *Server) NackSingle(route string, leaseID string, dead bool, reason string, delay time.Duration) *OpError
- func (s *Server) ServeHTTP(w http.ResponseWriter, r *http.Request)
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
This section is empty.
Types ¶
type Authorizer ¶
func BearerTokenAuthorizer ¶
func BearerTokenAuthorizer(tokens [][]byte) Authorizer
type DequeueParams ¶ added in v1.4.0
type DequeueParams struct {
Batch int
MaxWait time.Duration
HasMaxWait bool
LeaseTTL time.Duration
HasLeaseTTL bool
}
DequeueParams captures normalized dequeue input for route-bound operations.
type DequeueResult ¶ added in v1.4.0
DequeueResult is the route-bound dequeue output.
type LeaseBatchResult ¶ added in v1.4.0
type LeaseBatchResult struct {
Succeeded int
Conflicts []queue.LeaseBatchConflict
}
LeaseBatchResult captures aggregate lease mutation output.
type OpError ¶ added in v1.4.0
OpError is a transport-neutral operation error for pull worker flows.
type Server ¶
type Server struct {
Store queue.Store
Target string
ResolveRoute func(endpoint string) (route string, ok bool)
Authorize Authorizer
ObserveDequeue func(route string, statusCode int, items []queue.Envelope)
ObserveAck func(route string, statusCode int, leaseID string, leaseExpired bool)
ObserveNack func(route string, statusCode int, leaseID string, leaseExpired bool)
ObserveExtend func(route string, statusCode int, leaseID string, extendBy time.Duration, leaseExpired bool)
DefaultLeaseTTL time.Duration
MaxBatch int
MaxLeaseBatch int
MaxLeaseTTL time.Duration
DefaultMaxWait time.Duration
MaxWait time.Duration
RecentLeaseOpTTL time.Duration
RecentLeaseOpCap int
// contains filtered or unexported fields
}
func (*Server) AckBatch ¶ added in v1.4.0
func (s *Server) AckBatch(route string, leaseIDs []string) (LeaseBatchResult, *OpError)
func (*Server) Dequeue ¶ added in v1.4.0
func (s *Server) Dequeue(route string, params DequeueParams) (DequeueResult, *OpError)
func (*Server) NackSingle ¶ added in v1.4.0
Click to show internal directories.
Click to hide internal directories.