Refactor auth to increase encapsulation #36
Merged
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
Hey @le0pard,
So I'm not sure how keen you would be with this pull request but this is the start of a refactor with which to provide proper encapsulation to different properties of the previously named
Auth
struct. It is now unexported and namedauth
while there is a replacement interface for it. The interface is now also an argument forKinesis
andClient
. Properties of the struct has also been unexported and instead have exported getter methods so that they are not mutable outside the struct instance itself.This refactor properly allows an HTTP client to be instantiated for the Kinesis client itself which will then lead to another smallish refactor to decouple the creation of the Kinesis client inside of
New
insidekinesis.go
.Please note, the changes in this pull request are not backwards compatible to the original work because the constructor's interfaces have changed. Instead of "inferring" what the configuration should look like, it forces the developer to know about their own environment and therefore using the specific convenience constructor to create their the
auth
struct.If this change is too big and unplanned, I'm also happy to discuss other strategies to get this in like wait until the refactor is complete before merging this pull request in or to spin this off into a separate project and credit back to this original repo. Please feel free to advise, thanks!