2021-09-02 17:22:39 +00:00
|
|
|
package common
|
|
|
|
|
2021-09-06 22:46:48 +00:00
|
|
|
import "github.com/by-cx/lobby/server"
|
2021-09-02 17:22:39 +00:00
|
|
|
|
|
|
|
// Listener is a function that returns received discovery
|
|
|
|
type Listener func(server.Discovery)
|
|
|
|
|
|
|
|
// Driver interface describes exported methods that have to be implemented in each driver
|
|
|
|
type Driver interface {
|
|
|
|
Init() error
|
|
|
|
Close() error
|
|
|
|
RegisterSubscribeFunction(listener Listener)
|
|
|
|
RegisterUnsubscribeFunction(listener Listener)
|
|
|
|
SendDiscoveryPacket(discovery server.Discovery) error
|
|
|
|
SendGoodbyePacket(discovery server.Discovery) error
|
|
|
|
}
|