Ecosyste.ms: Awesome
An open API service indexing awesome lists of open source software.
https://github.com/marianoguerra/ioriofn
ioriodb client and tests in efene
https://github.com/marianoguerra/ioriofn
Last synced: about 1 month ago
JSON representation
ioriodb client and tests in efene
- Host: GitHub
- URL: https://github.com/marianoguerra/ioriofn
- Owner: marianoguerra
- Created: 2015-06-16T16:27:53.000Z (over 9 years ago)
- Default Branch: master
- Last Pushed: 2015-07-17T13:40:41.000Z (over 9 years ago)
- Last Synced: 2023-04-21T08:16:31.666Z (over 1 year ago)
- Language: Erlang
- Homepage:
- Size: 1.1 MB
- Stars: 5
- Watchers: 1
- Forks: 1
- Open Issues: 0
-
Metadata Files:
- Readme: README.rst
Awesome Lists containing this project
README
ioriofn
=======An efene application to test ioriodb
Build
-----::
./rebar3 compile
Run Tests
---------::
./rebar3 ct
Use
---Start the erlang shell (no efene shell yet)::
./rebar3 shell
and then::
application:ensure_all_started(ioriofn).
random:seed().
Rnd = ioriofn_rnd:new().
ioriofn_metric:create_metrics().SenderCount = 20.
StreamsCount = SenderCount div 3.Username = <<"mariano">>.
Password = <<"secret">>.
Host = "localhost".
Port = 8080.
Bucket = list_to_binary(io_lib:format("_user_~s", [Username])).
Stream = <<"cc1">>.
Streams = ioriofn_tester:prefixed_streams("cc", StreamsCount).Opts = #{username => Username, password => Password,
host => Host, port => Port, bucket => Bucket}.{Senders, Rnd1} = ioriofn_tester:new_senders(Rnd, Opts, Streams, SenderCount).
{Readers, Rnd2} = ioriofn_tester:new_readers(Rnd1, Opts, Streams, SenderCount).To start metrics sender::
MetricsOpts = Opts#{stream => <<"ioriofn_metrics">>,
timeouts => [60000], messages => [fun ioriofn_metric:get_all_str_keys/0]}.
{ok, MetricSender} = ioriofn_sender:start_link(MetricsOpts).To get metrics::
ioriofn_metric:get_all().
To Stop the madness::
lists:map(fun ioriofn_sender:stop/1, Senders).
Basic usage::
application:ensure_all_started(ioriofn).
Host = "localhost".
Port = 8080.
Username = <<"mariano">>.
Password = <<"secret">>.{ok, C1} = ioriofn:new(Host, Port).
{ok, C2} = ioriofn:login(C1, Username, Password).ioriofn:ping(C2).
ioriofn:get_session(C2).ioriofn:list_buckets(C2).
ioriofn:list_streams(C2, <<"_user_mariano">>).
ioriofn:list_streams(C2, <<"public">>).ioriofn:grant_bucket(C2, <<"_user_mariano">>, <<"admin">>, get).
ioriofn:grant_bucket(C2, <<"_user_mariano">>, <<"admin">>, put).
ioriofn:grant_bucket(C2, <<"_user_mariano">>, <<"admin">>, grant).
ioriofn:grant_bucket(C2, <<"_user_mariano">>, <<"admin">>, foo).% this should fail
ioriofn:grant_bucket(C2, <<"_user_admin">>, <<"admin">>, get).
ioriofn:grant_bucket(C2, <<"_user_admin">>, <<"admin">>, put).
ioriofn:grant_bucket(C2, <<"_user_admin">>, <<"admin">>, grant).
ioriofn:grant_bucket(C2, <<"_user_admin">>, <<"admin">>, foo).ioriofn:grant_stream(C2, <<"_user_mariano">>, <<"public">>, <<"admin">>, get).
ioriofn:grant_stream(C2, <<"_user_mariano">>, <<"public">>, <<"admin">>, put).
ioriofn:grant_stream(C2, <<"_user_mariano">>, <<"public">>, <<"admin">>, grant).
ioriofn:grant_stream(C2, <<"_user_mariano">>, <<"public">>, <<"admin">>, foo).% this should fail
ioriofn:grant_stream(C2, <<"_user_admin">>, <<"public">>, <<"admin">>, get).
ioriofn:grant_stream(C2, <<"_user_admin">>, <<"public">>, <<"admin">>, put).
ioriofn:grant_stream(C2, <<"_user_admin">>, <<"public">>, <<"admin">>, grant).
ioriofn:grant_stream(C2, <<"_user_admin">>, <<"public">>, <<"admin">>, foo).TODO
----* define license and create LICENSE file
License
-------TODO