MingaAgent.Changeset.SourceRead (Minga v0.1.0)

Copy Markdown View Source

Bounded selection of a changeset-owned source with its atomic revision.

Summary

Functions

Selects requested lines without materializing or indexing the full resident source.

Copies only a bounded prefix out of the selected resident source.

Types

lines_result()

@type lines_result() ::
  {:ok,
   {:memory, binary(), non_neg_integer(), non_neg_integer() | :unknown,
    boolean()}
   | {:disk, String.t()}, non_neg_integer()}
  | {:error, term()}

prefix_result()

@type prefix_result() ::
  {:ok, {:memory, binary(), boolean()} | {:disk, String.t()}, non_neg_integer()}
  | {:error, term()}

source()

@type source() :: {:ok, {:memory, binary()} | {:disk, String.t()}} | {:error, term()}

Functions

lines(error, revision, start, count, max_bytes)

Selects requested lines without materializing or indexing the full resident source.

prefix(error, revision, max_bytes)

@spec prefix(source(), non_neg_integer(), pos_integer()) :: prefix_result()

Copies only a bounded prefix out of the selected resident source.