View Source hex_api_package (hex_core v0.10.0)

Hex HTTP API - Packages.

Link to this section Summary

Link to this section Functions

-spec get(hex_core:config(), binary()) -> hex_api:response().

Gets a package.

Examples:

  > hex_api_package:get(hex_core:default_config(), <<"package">>).
  {ok, {200, ..., #{
      <<"name">> => <<"package1">>,
      <<"meta">> => #{
          <<"description">> => ...,
          <<"licenses">> => ...,
          <<"links">> => ...,
          <<"maintainers">> => ...
      },
      ...,
      <<"releases">> => [
          #{<<"url">> => ..., <<"version">> => <<"0.5.0">>}],
          #{<<"url">> => ..., <<"version">> => <<"1.0.0">>}],
          ...
      ]}}}
Link to this function

search(Config, Query, SearchParams)

View Source
-spec search(hex_core:config(), binary(), [{term(), term()}]) -> hex_api:response().

Searches packages.

Examples:

  > hex_api_package:search(hex_core:default_config(), <<"package">>, [{page, 1}]).
  {ok, {200, ..., [
      #{<<"name">> => <<"package1">>, ...},
      ...
  ]}}