ing
This commit is contained in:
parent
6dc7895947
commit
5a8657a1f8
|
@ -13,8 +13,6 @@ import (
|
||||||
type Client interface {
|
type Client interface {
|
||||||
Start() error
|
Start() error
|
||||||
Stop()
|
Stop()
|
||||||
|
|
||||||
GetClientHandler() ClientHandler
|
|
||||||
}
|
}
|
||||||
|
|
||||||
func NewClient(ch ClientHandler) Client {
|
func NewClient(ch ClientHandler) Client {
|
||||||
|
@ -33,10 +31,6 @@ type client struct {
|
||||||
stopWg sync.WaitGroup
|
stopWg sync.WaitGroup
|
||||||
}
|
}
|
||||||
|
|
||||||
func (c *client) GetClientHandler() ClientHandler {
|
|
||||||
return c.clientHandler
|
|
||||||
}
|
|
||||||
|
|
||||||
func (c *client) Start() error {
|
func (c *client) Start() error {
|
||||||
if nil == c.clientHandler {
|
if nil == c.clientHandler {
|
||||||
panic("Client: client handler must be specified.")
|
panic("Client: client handler must be specified.")
|
||||||
|
|
|
@ -15,8 +15,6 @@ type Server interface {
|
||||||
Start() error
|
Start() error
|
||||||
Stop()
|
Stop()
|
||||||
Serve() error
|
Serve() error
|
||||||
|
|
||||||
GetServerHandler() ServerHandler
|
|
||||||
}
|
}
|
||||||
|
|
||||||
func NewServer(sh ServerHandler) Server {
|
func NewServer(sh ServerHandler) Server {
|
||||||
|
@ -37,10 +35,6 @@ type server struct {
|
||||||
stopWg sync.WaitGroup
|
stopWg sync.WaitGroup
|
||||||
}
|
}
|
||||||
|
|
||||||
func (s *server) GetServerHandler() ServerHandler {
|
|
||||||
return s.serverHandler
|
|
||||||
}
|
|
||||||
|
|
||||||
func (s *server) Start() error {
|
func (s *server) Start() error {
|
||||||
if nil == s.serverHandler {
|
if nil == s.serverHandler {
|
||||||
panic("Server: server handler must be specified.")
|
panic("Server: server handler must be specified.")
|
||||||
|
|
Loading…
Reference in New Issue
Block a user