Help us shape the future of Go! Take the 2026 Go Developer Survey

delivery

package
v0.1.0 Latest Latest
Warning

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

Go to latest
Published: Nov 1, 2026 License: MIT Imports: 11 Imported by: 0

Documentation

Overview

Package delivery owns one Cloudflare lease and its confirmed settlement.

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type Delivery

type Delivery struct {
	// contains filtered or unexported fields
}

Delivery is one leased Cloudflare message and the state to settle it once.

func New

func New(client *cloudflare.Client, accountID, queueID, leaseID string, message queue.Message, logger *slog.Logger, repeated error) *Delivery

New captures the completed envelope and borrows native request dependencies. Malformed-envelope failure handling can retain partially decoded fields.

func (*Delivery) Acknowledge

func (delivery *Delivery) Acknowledge(ctx context.Context) error

Acknowledge deletes the lease only after one matching acknowledgment.

func (*Delivery) Fail

func (delivery *Delivery) Fail(ctx context.Context, err error) error

Fail logs the supplied error unchanged and acknowledges without an archive.

func (*Delivery) Message

func (delivery *Delivery) Message() queue.Message

Message returns the job envelope with payload bytes and metadata copied.

func (*Delivery) Reject

func (delivery *Delivery) Reject(ctx context.Context) error

Reject locally settles without changing the native lease or redrive policy.

func (*Delivery) Retry

func (delivery *Delivery) Retry(ctx context.Context, delay time.Duration) error

Retry rounds positive delays up to seconds and requires one confirmed retry. Negative delay means zero; cancellation precedes the native maximum check.

Jump to

Keyboard shortcuts

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