hex_api_package (hex_core v0.7.1) View Source

HTTP API - Packages.

Link to this section Summary

Link to this section Functions

Specs

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

Specs

search(:hex_core.config(), binary(), [binary()]) :: :hex_api.response()

Searches packages.

Examples:

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