-
Notifications
You must be signed in to change notification settings - Fork 4
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Add VcrStorage abstraction #23
Conversation
You're very quick with these 😂 Thanks! I only noticed now, but it seems like the
It might be because |
Ah, I will look into jdk setup issues |
def apply(recordingPath: Path): FileVcrStorage = | ||
new FileVcrStorage(recordingPath, CirceCodec, StandardCharsets.UTF_8) |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Maybe implicit parameter is better to allow switching format (codec) to YAML or other?
def apply(recordingPath: Path)(implicit codec: Codec): FileVcrStorage =
new FileVcrStorage(recordingPath, codec, StandardCharsets.UTF_8)
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I'm not sure if it needs to be implicit. Maybe even default parameters (default of json) could work? I know some people don't like default parameters, but I'm already using them in the clients.
Also, maybe CirceCodec
should be renamed to JsonCodec
? Because circe also has a yaml library (https://github.com/circe/circe-yaml), which I imagine would be natural to use in this library. So we'd also have a YamlCodec
in the future, right?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Thank you. This looks good to me.
I think I can release the first version of this library tomorrow. I just need to update all the examples, add more scaladocs, and then add a few more tests.
Closes #22
This PR introduces
VcrStorage
abstraction.The trait abstract "reading record from somewhere" and "writing record to somewhere".
Codec
trait is also introduced.It abstract how
VcrEntries
isThis abstraction helps #3