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,14 @@
defmodule ExDataGovUA.Streamers.FileStreamer do
@chunk_size 2048
@spec export(Stream.t(), String.t()) :: Atom.t()
def export(stream, filename) do
stream
|> Stream.into(File.stream!(filename, [], @chunk_size))
end
@spec import(String.t()) :: File.Stream.t()
def import(filename) do
filename
|> File.stream!([], @chunk_size)
end
end

View File

@@ -0,0 +1,8 @@
defmodule ExDataGovUA.Streamers.HttpStreamer do
alias ExDataGovUA.Commons.HttpStream
def get(url) do
url
|> HttpStream.get()
end
end