it takes the event and in every plugin implementations it checks for the type of the event and unmarshals to the corresponding object. This behavior is same in all plugin implementations.
To minimize the code duplication change the interface to contain two methods:
Currently, we have
EventHandler
interface with one method:it takes the event and in every plugin implementations it checks for the type of the event and unmarshals to the corresponding object. This behavior is same in all plugin implementations. To minimize the code duplication change the interface to contain two methods:
and move the common logic to the
server.go