Created
July 29, 2017 04:07
-
-
Save shixzie/6bf6aa8da79d7e62347c12e6e2dfacbc to your computer and use it in GitHub Desktop.
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
func handlerForInterface(handler interface{}) EventHandler { | |
switch v := handler.(type) { | |
case func(*Session, interface{}): | |
return interfaceEventHandler(v) | |
case func(*Session, *ChannelCreate): | |
return channelCreateEventHandler(v) | |
case func(*Session, *ChannelDelete): | |
return channelDeleteEventHandler(v) | |
case func(*Session, *ChannelPinsUpdate): | |
return channelPinsUpdateEventHandler(v) | |
case func(*Session, *ChannelUpdate): | |
return channelUpdateEventHandler(v) | |
case func(*Session, *Connect): | |
return connectEventHandler(v) | |
case func(*Session, *Disconnect): | |
return disconnectEventHandler(v) | |
// . . . 37 more cases below | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment