Movatterモバイル変換


[0]ホーム

URL:


Skip to content

Navigation Menu

Sign in
Appearance settings

Search code, repositories, users, issues, pull requests...

Provide feedback

We read every piece of feedback, and take your input very seriously.

Saved searches

Use saved searches to filter your results more quickly

Sign up
Appearance settings

A tiny tiny Elixir library to stream big big files

License

NotificationsYou must be signed in to change notification settings

subvisual/http_stream

Repository files navigation

Build

HTTPStream is a tiny, tiny package that wraps HTTP requests into aStream sothat you can manage data on the fly, without keeping everything in memory.

Downloading an image:

HTTPStream.get(large_image_url)|>Stream.into(File.stream!("large_image.png"))|>Stream.run()

Streaming multiple images into a ZIP archive (usingzstream)

[Zstream.entry("a.png",HTTPStream.get(a_url))  Zstream.entry("b.png",HTTPStream.get(b_url))]|>Zstream.zip()|>Stream.into(File.stream!("archive.zip"))|>Stream.run()

Table of Contents

Installation

First, you need to addhttp_stream to your list of dependencies onmix.exs:

defdepsdo[{:http_stream,"~> 1.0.0"},# if using the Mint adapter:{:castore,"~> 0.1.7"},{:mint,"~> 1.1.0"}# if using the HTTPoison adapter:{:httpoison,"~> 1.7.0"}]end

HTTPStream comes with two adapters:Mint andHTTPoison.By defaultMint is configured but you need to include it in your dependencies.

To useHTTPoison, set in yourconfig/config.exs:

config:http_stream,adapter:HTTPStream.Adapter.HTTPoison

That's it! For more intricate API details, refer to thedocumentation.

Development

If you want to setup the project for local development, you can just run thefollowing commands.

git clone git@github.com:subvisual/http_stream.gitcd http_streambin/setup

PRs and issues welcome.

Contributing

Feel free to contribute!

If you found a bug, open an issue. You can also open a PR for bugs or newfeatures. Your PRs will be reviewed and subjected to our styleguide and linters.

All contributionsmust follow theCode of ConductandSubvisual's guides.

About

HTTPStream is maintained with ❤️ bySubvisual.


Subvisual

About

A tiny tiny Elixir library to stream big big files

Topics

Resources

License

Code of conduct

Stars

Watchers

Forks

Packages

No packages published

[8]ページ先頭

©2009-2025 Movatter.jp