forked from cossacklabs/themis
-
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.
Rename session.SessionCallbacks interface
This renaming is more involved that other ones. Interfaces are hard. First of all, introduce a new interface with identifiers that do not offend golint: - use "Callbacks" instead of "SessionCallbacks" to avoid stuttering when importing (it will be called "session.Callbacks" in user code) - use "GetPublicKeyID" method name instead of "GetPublicKeyId" Then update all existing code to use the new interface. Secure Session itself should call the new method, accept and store Callbacks instance. Users of Secure Session should implement the new GetPublicKeyID method. However, in order to maintain backwards compatibility we have to allow the old code to continue using the old SessionCallbacks interface with GetPublicKeyId method. We implement this using an adapter struct that translates new method calls into the old ones. Since Go does not have method overloading we have to accept an "interface {}" instance and check its type dynamically. These compatibility shims can be removed when we drop the old interface.
- Loading branch information
Showing
5 changed files
with
38 additions
and
8 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
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
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