Module logflare

Entry point to Logflare API.

Behaviours: gen_batch_server.

Description

Entry point to Logflare API

Data Types

dependency()

dependency() = module() | {module(), term()}

name()

name() = {local, atom()} | {global, term()} | {via, atom(), term()} | undefined

opt()

opt() = {base_url, uri_string:uri_string()} | {path, iolist() | binary()} | {api_key, iolist() | binary()} | {source_id, iolist() | binary()} | {gun_opts, gun:opts()} | {ordered, boolean()} | {min_batch_size, non_neg_integer()} | {max_batch_size, non_neg_integer()} | {low_batch_size_timeout, non_neg_integer()} | {clock, dependency()} | {gun, dependency()}

Function Index

async/2Sends a log message and immediately returns.
async_batch/2Sends a batch of log messages and immediately returns.
start_link/0Starts a logflare server.
start_link/1Starts a logflare server.
start_link/2Starts a logflare server.
sync/2Sends a log message and waits until the batch it is in, is posted.
sync/3Sends a log message and waits until the batch it is in, is posted.

Function Details

async/2

async(ServerRef::gen_batch_server:server_ref(), Log::term()) -> ok

Sends a log message and immediately returns

This won't guarantee that the message will reach the server

async_batch/2

async_batch(ServerRef::gen_batch_server:server_ref(), Logs::[term()]) -> ok

Sends a batch of log messages and immediately returns

This won't guarantee that the messagse will reach the server

start_link/0

start_link() -> {ok, pid()} | {error, term()}

Starts a logflare server

start_link/1

start_link(Opts::[opt()] | name()) -> {ok, pid()} | {error, term()}

Starts a logflare server

start_link/2

start_link(Name::name(), Opts::[opt()]) -> {ok, pid()} | {error, term()}

Starts a logflare server

sync/2

sync(ServerRef::gen_batch_server:server_ref(), Log::term()) -> ok

Sends a log message and waits until the batch it is in, is posted

Will timeout after 5000 milliseconds.

sync/3

sync(ServerRef::gen_batch_server:server_ref(), Log::term(), Timeout::timeout()) -> ok

Sends a log message and waits until the batch it is in, is posted

This version allows to specify a custom timeout.


Generated by EDoc