Module Conex_resource

module Conex_resource: sig .. end
Persistent data: on wire and record types

Every resource in conex is a piece of data (or metadata), and has its own purpose. Resources stored on disk consists of a common header: a name, a type, a counter, a wraparound counter, and a creation timestamp. There are broadly three kinds of resources: those containing identities (Conex_resource.Team and Conex_resource.Author), those regulating access to packages (Conex_resource.Authorisation), and those with the digests of the opam repository data (Conex_resource.Package and Conex_resource.Release).



Names and identifiers


type name = string 
The name of resources, used e.g. for package names.
val pp_name : name Conex_utils.fmt
pp_name name is a pretty printer for name.
val name_equal : name -> name -> bool
name_equal a b is the result of a case insensitive comparison of a and b.
type identifier = string 
The type of identifiers.
val pp_id : identifier Conex_utils.fmt
pp_id id is a pretty printer for identifier.
val id_equal : identifier -> identifier -> bool
id_equal a b is the result of a case insensitive comparison of a and b.

Wire format


module Wire: sig .. end
The wire encoding is abstract here, one suitable decoding and encoding engine is Conex_opam_encoding.

Resource types


type typ = [ `Account
| `Author
| `Authorisation
| `Key
| `Package
| `Release
| `Signature
| `Team
| `Wrap ]
The sum type of all possible resources.
val typ_to_string : typ -> string
resource_to_string res is the string representation of res.
val string_to_typ : string -> typ option
string_to_resource str is either Some resource or None.
val pp_typ : typ Conex_utils.fmt
pp_resource pp is a pretty printer for resource.
val typ_equal : typ -> typ -> bool
resource_equal a b is true if they are the same, otherwise false.
val typ_of_wire : Wire.s -> (typ, string) Pervasives.result
module Header: sig .. end
Common header on disk

Asymmetric key types


module Key: sig .. end

Cryptographic signatures


module Signature: sig .. end

Digests


module Digest: sig .. end

Author


module Author: sig .. end
An author contains a list of approved resources (name, typ, digest).

Team


module Team: sig .. end
A team consists of a group of authors.

Authorisation


module Authorisation: sig .. end
An authorisation contains the information who is authorised to modify a package.

Package


module Package: sig .. end
A package lists all releases of a given package.

Release


module Release: sig .. end
A release contains a map of all files in the repository relevant for this release and their digests.