Expand description
Public API of pesto, intended for integration with upapasta, penne
and sugo.
pesto is a fast, lean Usenet poster: it yEnc-encodes files, posts the
resulting articles over NNTP and emits an .nzb file. See ROADMAP.md for
the development plan.
§Embedding
The minimal surface for embedding callers is post: pass a resolved
config::Config and the list of walk::InputFiles; get back a
poster::PostOutcome. Progress events are delivered on the
progress::ProgressReceiver returned alongside the outcome; drop it to
silence reporting.
use pesto::{config::Config, walk::InputFile};
let config = Config { /* ... */ };
let files = vec![InputFile { path: "movie.mkv".into(), real_name: None }];
let (outcome, _events) = pesto::post(config, files).await?;
println!("posted {} segments", outcome.segments.len());The supported embedding surface and its compatibility tiers are documented
in docs/pesto-embedding-api.md in the workspace repository. Child modules
that only organize an implementation are private; use the items re-exported
by their domain facade (for example, config and yenc).
Re-exports§
pub use parmesan as par2;
Modules§
- article
- Article assembly: the Usenet headers (
From,Newsgroups,Subject,Message-ID,Date) wrapped around a yEnc-encoded body, plus uniqueMessage-IDgeneration. - cancel
- Unified cancellation support for pesto.
- compress
- Archive compression before posting (Phase 13).
- config
- history
- Upload history log.
- hooks
- Post-upload hook execution.
- logging
- Logging initialisation for the
--verboseflag. - memory
- Process memory footprint: address-space accounting and startup tuning.
- nfo
- NFO file generation.
- nntp
- NNTP client: TLS connection, authentication and the
POSTcommand. - notify
- Completion notifications: webhook (Discord / Slack / Telegram / generic) and ntfy.sh topics.
- nzb
.nzbgeneration, parsing and the shared metadata model.- poster
- Parallel posting: the orchestration that ties together file reading, yEnc encoding, article assembly and the NNTP client.
- progress
- Progress reporting.
- resume
- Upload resume: persist already-posted segments so an interrupted run can continue without re-sending articles the server already accepted.
- spool
- Type-1 resume spool: cache the fully-encoded article (headers + yEnc
body, under the exact
Message-IDit was sent with) for a segment right before it goes over the wire, so aPOSTwhose240acknowledgement is lost to a dropped connection can be resumed by replaying the exact same bytes under the exact same Message-ID — instead of silently re-encoding and re-posting under a fresh one, which risks a duplicate article on the server if the originalPOSTactually succeeded. - ui
- Upload progress presentation.
- update
pesto --update: fetch the latestpesto-v*GitHub release for the platform pesto is currently running on, verify its SHA256 against theSHA256SUMSfile published alongside it, and replace the running binary in place.- upload
- Full upload pipeline: compress → post → NZB → history → notifications → hooks.
- walk
- Expansion of CLI path arguments into a flat list of files to post.
- yenc
- yEnc encoder.
Constants§
- DISPLAY_
VERSION - Shown by
--versionand the startup banner.
Functions§
- post
- Post
filesto Usenet usingconfigand return the outcome together with aprogress::ProgressReceiverthe caller can drain for live updates. - post_
cancelable - Like
postbut accepts an external cancel flag. - post_
pausable - Like
post_cancelablebut also accepts an external pause flag.