Skip to content

Refactor auth to increase encapsulation #36

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

Merged

Conversation

wchan2
Copy link
Contributor

@wchan2 wchan2 commented May 26, 2015

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 named auth while there is a replacement interface for it. The interface is now also an argument for Kinesis and Client. 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!

@wchan2 wchan2 force-pushed the refactor-auth-to-increase-encapsulation branch from 24390a9 to 6ed5372 Compare May 26, 2015 04:39
@wchan2 wchan2 force-pushed the refactor-auth-to-increase-encapsulation branch from 6ed5372 to d5427eb Compare May 26, 2015 12:41
@le0pard
Copy link
Contributor

le0pard commented May 26, 2015

Looks good for me. Just will create version 1.0.0 by semver.

le0pard added a commit that referenced this pull request May 26, 2015
…ation

Refactor auth to increase encapsulation
@le0pard le0pard merged commit 50e10d7 into sendgridlabs:master May 26, 2015
@wchan2 wchan2 deleted the refactor-auth-to-increase-encapsulation branch May 27, 2015 01:51
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants