package opam-format

  1. Overview
  2. Docs

Repository metadata

include IO_FILE
type t

File contents

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 -> Pervasives.in_channel -> t
val read_from_string : ?filename:t typed_file -> string -> t
val write_to_channel : ?filename:t typed_file -> Pervasives.out_channel -> t -> unit
val write_to_string : ?filename:t typed_file -> t -> string
val create : ?browse:string -> ?upstream:string -> ?opam_version:OpamVersion.t -> ?redirect:(string * OpamTypes.filter option) list -> unit -> t
val opam_version : t -> OpamVersion.t

The minimum OPAM version required for this repository

val browse : t -> string option

Base URL for browsing packages on the WWW

val upstream : t -> string option

Base URL for browsing OPAM repository source on the WWW

val redirect : t -> (string * OpamTypes.filter option) list

Redirections.

val with_opam_version : OpamVersion.t -> t -> t
val with_browse : string -> t -> t
val with_upstream : string -> t -> t
val with_redirect : (string * OpamTypes.filter option) list -> t -> t
OCaml

Innovation. Community. Security.