Skip to content
This repository has been archived by the owner on Aug 29, 2023. It is now read-only.

feat: new WriteTo method. #53

Merged
merged 3 commits into from
Oct 4, 2021
Merged

feat: new WriteTo method. #53

merged 3 commits into from
Oct 4, 2021

Conversation

owulveryck
Copy link
Collaborator

As exposed in #52 , I introduce this method to write the zipfile to an io.Writer.
This can be helpful if the EPUB generation is embedded in a webserver for example.

This PR introduces the WriteTo(w io.Writer) (int64, error) method to the EPUB structure.
The EPUB structure is therefore fulfilling the io.WriterTo interface.

The Write method has been modified to use this new method. The destination is a file created within the Write method.

The existing tests should be enough to validate the new method. I added one new test to validate the counter of the bytes written.

This method is makes the EPUB structu fulfiling the io.WriterTo interface
@owulveryck owulveryck marked this pull request as draft October 3, 2021 13:27
A lot of panic functions are encapsulating into return error.
This makes it easier to catch the exit door of the function.
@owulveryck owulveryck marked this pull request as ready for review October 3, 2021 14:02
@bmaupin bmaupin merged commit c787abe into bmaupin:main Oct 4, 2021
@bmaupin
Copy link
Owner

bmaupin commented Oct 4, 2021

Looks great, thanks!

@bmaupin
Copy link
Owner

bmaupin commented Oct 4, 2021

If I understand correctly from #52, it sounded like there was more work you wanted to do. Let me know if you'd like me to make a new release now, otherwise I'll wait until #52 is closed.

Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

2 participants