package capnp-rpc-unix

  1. Overview
  2. Docs
Cap'n Proto is a capability-based RPC system with bindings for many languages

Install

dune-project
 Dependency

Authors

Maintainers

Sources

capnp-rpc-2.1.1.tbz
sha256=6e9675034c8eac5873ed511f9b968db5223278145bb02ac4a970053a53970a48
sha512=2e2eb8389071bdad3ceef1d15200bf28987f13319f754f4d1603828d0d79202b4de90a6eb294f12ee088c7e3b73755286fbe7076b8fd3d0b29644221e0e7e080

doc/capnp-rpc-unix/Capnp_rpc_unix/Vat_config/index.html

Module Capnp_rpc_unix.Vat_configSource

Configuration for a Vat.

Sourcetype t
Sourceval create : ?backlog:int -> ?public_address:Network.Location.t -> secret_key:[< `File of _ Eio.Path.t | `PEM of string | `Ephemeral ] -> ?serve_tls:bool -> net:_ Eio.Net.t -> Network.Location.t -> t

create ~secret_key ~net listen_address is the configuration for a server vat that listens on address listen_address. secret_key may be one of:

  • `File path: a PEM-encoded RSA private key is read from path. If path doesn't yet exist, a new key is created and stored there.
  • `PEM data: the given PEM-encoded data is used as the key.
  • `Ephemeral: a new key is generated (if needed) and not saved anywhere. If serve_tls is false then the vat accepts unencrypted incoming connections. If true (the default), the vat performs a server TLS handshake, using secret_key to prove its identity to clients. backlog is passed to Unix.listen. The vat will suggest that others connect to it at public_address (or listen_address if no public address is given).

secret_key t returns the vat's secret yet, generating it if this is the first time it has been used.

Sourceval hashed_secret : t -> string

hashed_secret t is the SHA256 digest of the secret key file. This is useful as an input to Restorer.Id.derived.

Sourceval derived_id : t -> string -> Capnp_rpc_net.Restorer.Id.t

derived_id t name is a secret service ID derived from name and the vat's secret key (using Restorer.Id.derived). It won't change (unless the vat's key changes).

Sourceval sturdy_uri : t -> Capnp_rpc_net.Restorer.Id.t -> Uri.t

sturdy_uri t id is a sturdy URI for id at the vat that would be created by t.

Sourceval pp : t Fmt.t

This is probably only useful for the unit-tests.

Sourceval equal : t -> t -> bool

This is probably only useful for the unit-tests.

Sourcetype 'a env = 'a constraint 'a = < net : _ Eio.Net.t ; fs : _ Eio.Path.t.. > as 'a
Sourceval cmd : _ env -> t Cmdliner.Term.t

cmd env evaluates to a configuration populated from the command-line options.