package datakit-client-9p

  1. Overview
  2. Docs

Parameters

Signature

include Datakit_client.S
type t

A t is a connection to a Datakit server.

type error = private [>
  1. | `Already_exists
    (*

    Attempt to create something that already exists

    *)
  2. | `Does_not_exist
    (*

    Attempt to access something that does not exist

    *)
  3. | `Is_dir
    (*

    Attempt to use a directory as a file

    *)
  4. | `Not_dir
    (*

    Attempt to use a non-directory as a directory

    *)
  5. | `Not_file
    (*

    Attempt to use a non-file as a file

    *)
]

Attempt to use a non-symlink as a symlink

val pp_error : error Fmt.t

pp_error pretty-prints error values.

type +'a result = ('a, error) Result.result Lwt.t
module Infix : sig ... end

Infix operators for client results.

module Tree : Datakit_client.READABLE_TREE with type 'a result := 'a result

A read-only tree of files, directories and symlinks.

module Commit : sig ... end
module Transaction : sig ... end

All changes to a branch are made in transactions. When a transaction is committed, it is merged with the current contents of the branch.

module Branch : sig ... end
val branches : t -> string list result

branches t is the current set of branches.

val remove_branch : t -> string -> unit result

remove_branch t name removes the branch named name (unlike Branch.remove, this method doesn't require creating the branch directory first).

val branch : t -> string -> Branch.t result

branch t name is the branch named name (which might not exist yet).

val commit : t -> string -> Commit.t result

commit t hash is the commit with ID hash.

val tree : t -> string -> Tree.t result

tree t id is the tree with ID id.

val fetch : t -> url:string -> branch:string -> Commit.t result

fetch t ~url ~branch fetches the given remote branch and returns its head commit.

val disconnect : t -> unit result

disconnect t closes the connection. t cannot be used after this.

val connect : P9p.t -> t

connect c is a Datakit connection using the 9p connection c.

OCaml

Innovation. Community. Security.