package opam-format

  1. Overview
  2. Docs

Urls for OPAM repositories

include IO_FILE
type t

File contents

val format_version : OpamVersion.t
val empty : t

Empty file

val write : t typed_file -> t -> unit

Write some contents to a file

val read : t typed_file -> t

Read file contents. Raise an error if the file does not exist.

val read_opt : t typed_file -> t option

Returns None on non-existing file

val safe_read : t typed_file -> t

Read file contents. Return empty if the file does not exist.

val read_from_channel : ?filename:t typed_file -> Stdlib.in_channel -> t
val read_from_string : ?filename:t typed_file -> string -> t
val write_to_channel : ?filename:t typed_file -> Stdlib.out_channel -> t -> unit
val write_to_string : ?filename:t typed_file -> t -> string
val create : ?mirrors:OpamTypes.url list -> ?checksum:OpamHash.t list -> ?swhid:OpamSWHID.t -> ?subpath:OpamTypes.subpath -> OpamTypes.url -> t
val url : t -> OpamTypes.url

URL address

val mirrors : t -> OpamTypes.url list
val checksum : t -> OpamHash.t list

Archive checksum

val swhid : t -> OpamSWHID.t option
val with_url : OpamTypes.url -> t -> t

Constructor

val with_checksum : OpamHash.t list -> t -> t
val with_mirrors : OpamUrl.t list -> t -> t
val with_swhid : OpamSWHID.t -> t -> t
val with_swhid_opt : OpamSWHID.t option -> t -> t
val with_subpath : OpamTypes.subpath -> t -> t
val with_subpath_opt : OpamTypes.subpath option -> t -> t
val subpath : t -> OpamTypes.subpath option
OCaml

Innovation. Community. Security.