Add emqx_topic:tokens/1 function

This commit is contained in:
Feng Lee 2019-03-13 14:46:54 +08:00 committed by turtleDeng
parent 513d2bcaaa
commit a4550a8fc4
1 changed files with 5 additions and 0 deletions

View File

@ -157,6 +157,11 @@ levels(Topic) when is_binary(Topic) ->
tokens(Topic) ->
binary:split(Topic, <<"/">>, [global]).
%% @doc Split topic to tokens.
-spec(tokens(topic()) -> list(binary())).
tokens(Topic) ->
binary:split(Topic, <<"/">>, [global]).
%% @doc Split Topic Path to Words
-spec(words(topic()) -> words()).
words(Topic) when is_binary(Topic) ->