Aura.Common (Aura v0.9.0)

View Source

Common capabilities across all Aura services

Summary

Types

The path parameter of the request (e.g "/api/packages")

An email address associated with this record

Name of the package (e.g "plug")

A unique, human-readable ID for a user

Functions

Determines a api_path/0 by investigating opts for a :repo key, representing a Aura.Model.HexRepo.

Implements Hex API's pagination mechanism by returning a Stream.resource/3

Types

api_path()

@type api_path() :: String.t()

The path parameter of the request (e.g "/api/packages")

email()

@type email() :: String.t()

An email address associated with this record

package_name()

@type package_name() :: String.t()

Name of the package (e.g "plug")

username()

@type username() :: String.t()

A unique, human-readable ID for a user

Functions

determine_path(opts, path)

@spec determine_path(opts :: [any()], path :: api_path()) :: {api_path(), [any()]}

Determines a api_path/0 by investigating opts for a :repo key, representing a Aura.Model.HexRepo.

If present, path will be modified to scope solely to that repo, otherwise the path is unmodified.

stream_paginate(path, build_func, opts)

@spec stream_paginate(
  path :: api_path(),
  build_func :: (map() -> map()),
  opts :: list()
) ::
  Enumerable.t()

Implements Hex API's pagination mechanism by returning a Stream.resource/3