Modules

hex_api_key hex_api_package hex_api_package_owner hex_api_release hex_api_user hex_core hex_http hex_pb_names hex_pb_package hex_pb_signed hex_pb_versions hex_registry hex_repo hex_tarball

Module hex_api_package

Function Index

get/2 Gets a package.
search/3 Searches packages.

Function Details

get/2


        get(Config::hex_core:config(), Name::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">>}],
                  ...
              ]}}}
        

search/3


        search(Config::hex_core:config(), Query::binary(), SearchParams::[binary()]) -> hex_api:response()
        

Searches packages.

Examples:

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