mochi/apq

Types

pub type Error {
  NotFound
  HashMismatch(expected: String, actual: String)
}

Constructors

  • NotFound
  • HashMismatch(expected: String, actual: String)
pub type Extension {
  Extension(version: Int, sha256_hash: String)
}

Constructors

  • Extension(version: Int, sha256_hash: String)
pub type Store {
  Store(queries: dict.Dict(String, String))
}

Constructors

Values

pub fn hash(query: String) -> String
pub fn lookup(store: Store, h: String) -> option.Option(String)
pub fn new() -> Store
pub fn parse_extension(
  extensions: dict.Dict(String, dynamic.Dynamic),
) -> option.Option(Extension)
pub fn process(
  store: Store,
  query: option.Option(String),
  h: String,
) -> Result(#(Store, String), Error)
pub fn register(store: Store, query: String) -> #(Store, String)
pub fn size(store: Store) -> Int
pub fn with_queries(queries: List(String)) -> Store
Search Document