forked from openshift/osin
-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
* Change Client to be an interface * Add Clone and Close methods to Storage * Add Close method to Response and required it to be closed with defer on use
- Loading branch information
1 parent
1132b9a
commit cca734b
Showing
19 changed files
with
222 additions
and
66 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,19 @@ | ||
2014-06-25 | ||
========== | ||
* BREAKING CHANGES: | ||
- Storage interface has 2 new methods, Clone and Close, to better support storages | ||
that need to clone / close in each connection (mgo) | ||
- Client was changed to be an interface instead of an struct. Because of that, | ||
the Storage interface also had to change, as interface is already a pointer. | ||
|
||
- HOW TO FIX YOUR CODE: | ||
+ In your Storage, add a Clone function returning itself, and a do nothing Close. | ||
+ In your Storage, replace all *osin.Client with osin.Client (remove the pointer reference) | ||
+ If you used the osin.Client struct directly in your code, change it to osin.DefaultClient, | ||
which is a struct with the same fields that implements the interface. | ||
+ Change all accesses using osin.Client to use the methods instead of the fields directly. | ||
+ You MUST defer Response.Close in all your http handlers, otherwise some | ||
Storages may not clean correctly. | ||
|
||
resp := server.NewResponse() | ||
defer resp.Close() |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Oops, something went wrong.