pullapi

package
v1.5.0 Latest Latest
Warning

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

Go to latest
Published: Feb 15, 2026 License: Apache-2.0 Imports: 12 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type Authorizer

type Authorizer func(r *http.Request) bool

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

type DequeueResult struct {
	Items []queue.Envelope
}

DequeueResult is the route-bound dequeue output.

type Handler

type Handler interface {
	ServeHTTP(w http.ResponseWriter, r *http.Request)
}

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

type OpError struct {
	StatusCode int
	Code       string
	Detail     string
}

OpError is a transport-neutral operation error for pull worker flows.

func (*OpError) Error added in v1.4.0

func (e *OpError) Error() string

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 NewServer

func NewServer(store queue.Store) *Server

func (*Server) AckBatch added in v1.4.0

func (s *Server) AckBatch(route string, leaseIDs []string) (LeaseBatchResult, *OpError)

func (*Server) AckSingle added in v1.4.0

func (s *Server) AckSingle(route string, leaseID string) *OpError

func (*Server) Dequeue added in v1.4.0

func (s *Server) Dequeue(route string, params DequeueParams) (DequeueResult, *OpError)

func (*Server) Extend added in v1.4.0

func (s *Server) Extend(route string, leaseID string, extendBy time.Duration) *OpError

func (*Server) NackBatch added in v1.4.0

func (s *Server) NackBatch(route string, leaseIDs []string, dead bool, reason string, delay time.Duration) (LeaseBatchResult, *OpError)

func (*Server) NackSingle added in v1.4.0

func (s *Server) NackSingle(route string, leaseID string, dead bool, reason string, delay time.Duration) *OpError

func (*Server) ServeHTTP

func (s *Server) ServeHTTP(w http.ResponseWriter, r *http.Request)

Jump to

Keyboard shortcuts

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