View Source locus_maxmind_download (locus v2.3.7)

Downloads an unpacked database edition from MaxMind, as well as its checksum (which it then verifies), without blocking the caller.

Link to this section Summary

Link to this section Types

Specs

Specs

msg() ::
    {event, event()} |
    {finished, {error, no_license_key_defined}} |
    {finished, {error, {checksum_download, term()}}} |
    {finished, {error, {bad_checksum, #{expected := binary(), actual := binary()}}}} |
    {finished, {error, {bad_checksum_format, binary()}}} |
    locus_http_download:msg().

Specs

opt() :: {license_key, binary() | string()} | {date, calendar:date()} | locus_http_download:opt().

Specs

state() :: #state{}.

Specs

success() :: locus_http_download:success().

Link to this section Functions

Link to this function

code_change(OldVsn, State, Extra)

View Source

Specs

code_change(term(), state(), term()) -> {ok, state()}.
Link to this function

handle_call(Call, From, State)

View Source

Specs

handle_call(term(), {pid(), reference()}, state()) -> {stop, unexpected_call, state()}.
Link to this function

handle_cast(Cast, State)

View Source

Specs

handle_cast(term(), state()) -> {stop, unexpected_cast, state()}.
Link to this function

handle_info(Info, State)

View Source

Specs

handle_info(term(), state()) ->
               {noreply, state()} |
               {stop, normal, state()} |
               {stop, {database_download_stopped, pid(), term()}, state()} |
               {stop, {checksum_download_stopped, pid(), term()}, state()} |
               {stop, unexpected_info, state()}.

Specs

init(_) -> no_return().

Specs

init_([InitArg, ...]) -> no_return()
         when
             InitArg :: OwnerPid | Edition | RequestHeaders | Opts,
             OwnerPid :: pid(),
             Edition :: atom(),
             RequestHeaders :: locus_http_download:headers(),
             Opts :: [opt()].
Link to this function

start_link(Edition, RequestHeaders, Opts)

View Source

Specs

start_link(atom(), locus_http_download:headers(), [opt()]) -> {ok, pid()}.
Link to this function

terminate(Reason, State)

View Source

Specs

terminate(term(), state()) -> ok.
Link to this function

validate_opts(MixedOpts)

View Source

Specs

validate_opts(proplists:proplist()) ->
                 {ok, {[opt()], proplists:proplist()}} | {error, BadOpt :: term()}.