This commit is contained in:
crusader 2017-12-01 16:02:55 +09:00
parent 2103ea902f
commit f1974f7197
3 changed files with 22 additions and 11 deletions

View File

@ -1,15 +1,24 @@
package client
import (
"git.loafle.net/commons_go/rpc/client"
crc "git.loafle.net/commons_go/rpc/client"
crcrwf "git.loafle.net/commons_go/rpc/client/rwc/websocket/fasthttp"
cwfc "git.loafle.net/commons_go/websocket_fasthttp/client"
)
func New(clientHandler ClientHandler, socketBuilder cwfc.SocketBuilder) client.Client {
func New(clientHandler ClientHandler, socketBuilder cwfc.SocketBuilder) Client {
cRWCHandler := crcrwf.New(socketBuilder)
c := client.New(clientHandler, cRWCHandler)
c := &client{}
c.Client = crc.New(clientHandler, cRWCHandler)
return c
}
type Client interface {
crc.Client
}
type client struct {
crc.Client
}

View File

@ -1,7 +1,9 @@
package client
import "git.loafle.net/commons_go/rpc/client"
import (
crc "git.loafle.net/commons_go/rpc/client"
)
type ClientHandler interface {
client.ClientHandler
crc.ClientHandler
}

View File

@ -1,19 +1,19 @@
package client
import (
"git.loafle.net/commons_go/rpc"
"git.loafle.net/commons_go/rpc/client"
"git.loafle.net/commons_go/rpc/protocol/json"
cr "git.loafle.net/commons_go/rpc"
crc "git.loafle.net/commons_go/rpc/client"
crpj "git.loafle.net/commons_go/rpc/protocol/json"
)
func NewClientHandler(registry rpc.Registry) ClientHandler {
func NewClientHandler(registry cr.Registry) ClientHandler {
ch := &ClientHandlers{}
ch.RPCRegistry = registry
ch.Codec = json.NewClientCodec()
ch.Codec = crpj.NewClientCodec()
return ch
}
type ClientHandlers struct {
client.ClientHandlers
crc.ClientHandlers
}