Skip to main content

Crate ostrya_remote

Crate ostrya_remote 

Source
Expand description

The wire codec and the client sessions of the ostrya push and pull.

A caller pushes a local directory as a commit that the server makes with push_tree, or its own objects with a PushSession. A PullSession reads the summary and the ref listings of a remote. The crate has no repository knowledge, and it compiles on Linux, macOS, and Windows.

With the s3 feature, the s3 module signs S3 requests, reads the settings and the credentials of an S3 endpoint, and holds the client of a bucket repository. PullSession::connect opens a pull session to an S3 endpoint, over HTTP with a fetcher that signs each request.

§Entry points

§Modules

  • proto: the wire format and its codec.
  • session: the push and pull sessions, their progress, and the one-way stream.
  • transport: the endpoints, the addresses, and the ssh and HTTP transports.
  • tree: the walk and the hash of a local directory.
  • s3 (feature s3): S3 request signing, the settings and credentials of an S3 endpoint, the address of a bucket repository, and the bucket client.

§Features

  • smol (default): the smol backend of ostrya-rt for the ssh and HTTP transports.
  • tokio: the tokio backend of ostrya-rt for the ssh and HTTP transports.
  • s3: the s3 module, which signs S3 requests with AWS Signature Version 4, reads the AWS credentials, and holds the bucket client.

§Examples

use ostrya_core::Ref;
use ostrya_remote::{TreePushOptions, push_tree, transport::Endpoint};
let endpoint = Endpoint::parse("ssh://builder@repo.example.com/srv/repo")?;
let opts = TreePushOptions { onto: Ref::local("exampleos/stable"), ..Default::default() };
let outcome = push_tree(endpoint, "rootfs".as_ref(), opts).await?;
println!("{:?}", outcome.commit);

Modules§

proto
The wire format of the push and the pull, and its codec.
s3s3
S3 request signing, the settings and credentials of an S3 endpoint, the address of a bucket repository, and the bucket client.
session
The client sessions of the push and of the pull, and the one-way stream.
transport
The endpoints, and the ssh and HTTP transports of the sessions.
tree
The walk of a local directory into a tree model.

Structs§

ScannedTree
A tree that scan_tree walked and hashed, with the checked inputs of its commit.
TreePushOptions
The options of a tree push.

Enums§

Error
The error of each fallible operation of this crate.
ErrorCode
The wire code of an Error message.

Functions§

push_tree
Pushes the directory root to endpoint as one server commit.
push_tree_over_stream
Pushes the directory root as one server commit over a pair of byte streams.
push_tree_prepared
Pushes the directory root as one server commit over a prepared transport.
scan_tree
Checks opts and scans the directory root, with no transport.

Type Aliases§

Result
The result type of this crate, with Error as its error.