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.

§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.

§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.

§Examples

use ostrya_remote::{TreePushOptions, push_tree, transport::Endpoint};
let endpoint = Endpoint::parse("ssh://builder@repo.example.com/srv/repo")?;
let opts = TreePushOptions { onto: "exampleos/stable".into(), ..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.
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§

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.

Type Aliases§

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