Clairvoyant.Parser behaviour (clairvoyant v0.1.0)

Copy Markdown View Source

Behaviour every lockfile format parser implements.

Summary

Functions

Pick the right parser module for a given file path, by filename.

Callbacks

detect?(filename)

@callback detect?(filename :: String.t()) :: boolean()

parse(path)

@callback parse(path :: String.t()) :: {:ok, Clairvoyant.Graph.t()} | {:error, String.t()}

Functions

for_file(path)

@spec for_file(String.t()) :: {:ok, module()} | {:error, String.t()}

Pick the right parser module for a given file path, by filename.