ing
This commit is contained in:
parent
2103ea902f
commit
f1974f7197
|
@ -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
|
||||
}
|
||||
|
|
|
@ -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
|
||||
}
|
||||
|
|
|
@ -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
|
||||
}
|
||||
|
|
Loading…
Reference in New Issue
Block a user