package tar-mirage

  1. Overview
  2. Docs
Legend:
Library
Module
Module type
Parameter
Class
Class type

Construct a read-write key-value store from an existing block device containing tar-format data. Note that it is append-only meaning removing or renaming files is currently unsupported and will return an error.

Parameters

module CLOCK : Mirage_clock.PCLOCK

Signature

include Mirage_kv.RW
type nonrec error = private [>
  1. | Mirage_kv.error
]
val pp_error : error Fmt.t
type t
val disconnect : t -> unit Lwt.t
type key = Mirage_kv.Key.t
val exists : t -> key -> ([ `Dictionary | `Value ] option, error) Stdlib.result Lwt.t
val get : t -> key -> (string, error) Stdlib.result Lwt.t
val get_partial : t -> key -> offset:int -> length:int -> (string, error) Stdlib.result Lwt.t
val list : t -> key -> ((string * [ `Dictionary | `Value ]) list, error) Stdlib.result Lwt.t
val last_modified : t -> key -> (int * int64, error) Stdlib.result Lwt.t
val digest : t -> key -> (string, error) Stdlib.result Lwt.t
val size : t -> key -> (int, error) Stdlib.result Lwt.t
type nonrec write_error = private [>
  1. | Mirage_kv.write_error
]
val pp_write_error : write_error Fmt.t
val set : t -> key -> string -> (unit, write_error) Stdlib.result Lwt.t
val set_partial : t -> key -> offset:int -> string -> (unit, write_error) Stdlib.result Lwt.t
val remove : t -> key -> (unit, write_error) Stdlib.result Lwt.t
val rename : t -> source:key -> dest:key -> (unit, write_error) Stdlib.result Lwt.t
val batch : t -> ?retries:int -> (t -> 'a Lwt.t) -> 'a Lwt.t
val connect : BLOCK.t -> t Lwt.t

connect block

  • raises Invalid_argument

    if block has a sector size that is not a positive multiple of 512.

val free : t -> int64

free t is the number of unused bytes.

OCaml

Innovation. Community. Security.