Expand description
The delivery and network rules every file destination shares, written once.
A destination implements a few primitives on its server (Store: write a file, rename,
exists, delete, and what it can do atomically). deliver applies the rules on top:
if_exists(IfExists): replace a file already at the path, fail, or keep both by numbering the new one (report_2.xlsx);atomicandtemp_dir: upload under a temporary name (.<name>.dre-part, in the same folder or intemp_dir), then rename, so a half-written file never appears under its final name;retries: try again on a temporary error (a dropped connection, a 429 or 5xx), with backoff andRetry-After;connect_timeoutandtimeout, which the plugin applies to its client (Rulesparses them).
The Go plugin module has the same rules (go/plugin/delivery.go). LocalStore is the local
file system, used by core’s built-in local destination.
Structs§
- Caps
- What a store can do in one step.
- Delivered
- Where a delivery landed.
- Delivery
Error - A failed delivery.
- Local
Store - The local file system, for core’s
localdestination. Paths are file system paths. - Rules
- The rules for one delivery.
Enums§
- IfExists
- What to do when a file already exists at the delivery path.
- Retry
- What one try of a
retrystep gave. - Store
Error - Why a store operation failed.
Constants§
Traits§
- Store
- A destination’s primitives. Paths are the destination’s own (
outbound/report.xlsx).
Functions§
- connection_
fields - The connection fields every network plugin shares, for its
connection_fields(). - content_
type - The media type of a delivered file, by its extension: what an email attachment or an uploaded object is labelled, so the recipient’s mail client or browser opens it.
- deliver
- Deliver
localtoremoteunderrules, sleeping between retries. - deliver_
with deliver, with the wait between retries supplied (tests don’t wait).- is_
connection_ error - Whether an I/O error is a connection failing (refused, reset, aborted, timed out, closed early), which trying again may fix.
- option_
fields - The options every file destination shares, for its
options(). - parse_
duration - A duration:
30s,5m,2h,1500ms, or a bare number of seconds. - retry
- Run
f, trying again onRetry::Temporaryup toretriesmore times, with backoff (about 1s, then 4s, then 16s) or the server’sRetry-After. Each retry is logged at info level, namingwhat; a step that needed several tries is reported to core. - retry_
after - The
Retry-Afterof a 429 or 503, in seconds (an HTTP date isn’t read). - retry_
option_ fields - The retry options a destination entry may set over its profile’s:
retries,retry_waitandmax_retry_wait, for the plugin’soptions()(file destinations get them throughoption_fields). - retry_
rules retrywith a destination’sRules: itsretries,retry_waitandmax_retry_wait.- retry_
with retry, with the wait between tries supplied (tests don’t wait).- take_
attempts - The most tries a step took since the last call, at least 1; resets the count.
- timeout_
fields - The timeouts every network plugin shares (
connect_timeout,timeout), for itsconnection_fields(). Read them withRules::from_settings.