Initial commit

This commit is contained in:
2021-07-12 14:29:27 +03:00
parent 6c7cd5aee2
commit b48a9f5c58
28 changed files with 472 additions and 13 deletions

View File

@@ -0,0 +1,7 @@
defmodule ExDataGovUA.Archivers.Base do
@type stream :: Stream.t()
@callback deflate(stream) :: stream
@callback inflate(stream) :: stream
end

View File

@@ -0,0 +1,19 @@
defmodule ExDataGovUA.Archivers.Gz do
@behaviour ExDataGovUA.Archivers.Base
@type input :: Stream.t()
@type output :: Stream.t()
@spec deflate(input) :: output
@doc """
Pack data to archive
"""
def deflate(stream), do: stream |> StreamGzip.gzip
@spec inflate(input) :: output
@doc """
Extract data from archive
"""
def inflate(stream), do: stream |> StreamGzip.gunzip
end