Add type definition for auth_result

This commit is contained in:
terry-xiaoyu 2019-03-19 09:01:52 +08:00 committed by turtleDeng
parent e7320620c0
commit 36927f01e7
1 changed files with 9 additions and 0 deletions

View File

@ -40,10 +40,19 @@
-type(username() :: maybe(binary())).
-type(password() :: maybe(binary())).
-type(peername() :: {inet:ip_address(), inet:port_number()}).
-type(auth_result() :: success
| client_identifier_not_valid
| bad_username_or_password
| not_authorized
| server_unavailable
| server_busy
| banned
| bad_authentication_method).
-type(protocol() :: mqtt | 'mqtt-sn' | coap | stomp | none | atom()).
-type(credentials() :: #{client_id := client_id(),
username := username(),
peername := peername(),
result := auth_result(),
zone => zone(),
atom() => term()
}).