chunker v0.12.1 Chunker View Source
Provides functions to interact with chunked files.
Link to this section Summary
Functions
Appends data
to the given chunked_file
.
Closes the given chunked_file
.
Returns true
if the given chunked_file
has already been closed.
Commits the given chunked_file
.
Returns the data of the chunk with index
from the given
chunked_file
.
Inserts data
to the given chunked_file
at the position specified
by index
.
Returns the number of individual chunks the given chunked_file
consists of.
Prepends data
to the given chunked_file
.
Removes the given chunked_file
.
Removes the chunk with the corresponding index
from the given
chunked_file
.
Replaces the chunk with the corresponding index
with the given data
.
Returns true
if chunks can be added or removed from the given
chunked_file
.
Link to this section Types
Specs
error_tuple() :: {:error, reason()}
Specs
reason() :: any()
Specs
result() :: success_tuple() | error_tuple()
Specs
success_tuple() :: {:ok, t()}
Specs
t() :: Chunker.ChunkedFile.t()
Link to this section Functions
Specs
Appends data
to the given chunked_file
.
Specs
close(t()) :: :ok | error_tuple()
Closes the given chunked_file
.
After the file has been closed, it is not possible to read from it nor write to it.
Specs
Returns true
if the given chunked_file
has already been closed.
Specs
Commits the given chunked_file
.
After the file has been committed, chunks can no longer be added or removed.
Specs
get_chunk(t(), integer()) :: {:ok, bitstring()} | error_tuple()
Returns the data of the chunk with index
from the given
chunked_file
.
Specs
Inserts data
to the given chunked_file
at the position specified
by index
.
Specs
length(t()) :: {:ok, integer()} | error_tuple()
Returns the number of individual chunks the given chunked_file
consists of.
Specs
Prepends data
to the given chunked_file
.
Specs
remove(t()) :: :ok | error_tuple()
Removes the given chunked_file
.
Specs
Removes the chunk with the corresponding index
from the given
chunked_file
.
Specs
Replaces the chunk with the corresponding index
with the given data
.
Specs
Returns true
if chunks can be added or removed from the given
chunked_file
.