Initial commit
This commit is contained in:
7
lib/ex_data_gov_u_a/archivers/base.ex
Normal file
7
lib/ex_data_gov_u_a/archivers/base.ex
Normal file
@@ -0,0 +1,7 @@
|
||||
defmodule ExDataGovUA.Archivers.Base do
|
||||
@type stream :: Stream.t()
|
||||
|
||||
@callback deflate(stream) :: stream
|
||||
|
||||
@callback inflate(stream) :: stream
|
||||
end
|
||||
19
lib/ex_data_gov_u_a/archivers/gz.ex
Normal file
19
lib/ex_data_gov_u_a/archivers/gz.ex
Normal 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
|
||||
Reference in New Issue
Block a user