Skip to content
fieldmask implements Partial Responses protocol of Google+ API in Erlang.
Erlang Shell
Branch: master
Clone or download
Fetching latest commit…
Cannot retrieve the latest commit at this time.
Permalink
Type Name Latest commit message Commit time
Failed to load latest commit information.
doc
src
test
.gitignore
.travis.yml
LICENSE
README.md
hex.sh
rebar.config
rebar.config.script

README.md

fieldmask

Build Status Coverage Status hex.pm version hex.pm downloads hex.pm license GitHub top language

fieldmask implements Partial Responses protocol of Google+ API in Erlang, like json-mask in JavaScript and jsonmask in Python.

Mask of fieldmask is the same as fields parameter of Google+ API, for example, <<"a,b">> means the fields you want to keep is "a" and "b".

1> Mask = <<"a,b">>.
<<"a,b">>

And fieldmask use map object format of jsone to represent a JSON value.

2> Value = jsone:decode(<<"{\"a\":1, \"b\": 2, \"c\": 3}">>).
#{<<"a">> => 1,<<"b">> => 2,<<"c">> => 3}.

Call fieldmask:mask/2 to get the specific parts of a value you've selected.

3> fieldmask:mask(Mask, Value).
#{<<"a">> => 1,<<"b">> => 2}

Installation

add fieldmask dependency to your project's rebar.config

{deps, [fieldmask]}.

License

fieldmask is released under Apache 2 License. Check LICENSE file for more information.

You can’t perform that action at this time.