ex_wechat v0.1.7 Wechat.Token

Wechat Token(access_token, jsapi_ticket, wxcard_ticket) fetcher.

It contains a Agent to save tokens. A token only survive for 7190 seconds.

Summary

Functions

Get the access_token from wechat server

Get the jsapi_ticket from wechat server

Get the wxcard_ticket from wechat server

Initialize the cache and the checker

Start the Wechat.Token

Types

api()
api() :: atom
debug()
debug() :: [:trace | :log | :statistics | {:log_to_file, Path.t}]
name()
name() :: atom | {:global, term} | {:via, module, term}
on_start()
on_start ::
  {:ok, pid} |
  {:error, {:already_started, pid} | term}
option()
option ::
  {:debug, debug} |
  {:name, name} |
  {:timeout, timeout} |
  {:spawn_opt, Process.spawn_opt}
options()
options() :: [option]
state()
state() :: map
timestamp()
timestamp() :: non_neg_integer
token()
token() :: {token_key, token_value}
token_key()
token_key() :: {api, token_type}
token_string()
token_string() :: binary
token_type()
token_type() :: :access_token | :jsapi_ticket | :wxcard_ticket
token_value()
token_value() :: {token_value, timestamp}

Functions

_access_token(module)

Get the access_token from wechat server

_jsapi_ticket(module)

Get the jsapi_ticket from wechat server

_wxcard_ticket(module)

Get the wxcard_ticket from wechat server

init(args)
init(:ok) :: {:ok, state}

Initialize the cache and the checker

start_link(opts)
start_link(opts :: options) :: on_start

Start the Wechat.Token