From f1974f7197c705134d0db63330ac3040c4789c67 Mon Sep 17 00:00:00 2001 From: crusader Date: Fri, 1 Dec 2017 16:02:55 +0900 Subject: [PATCH] ing --- client/client.go | 15 ++++++++++++--- client/client_handler.go | 6 ++++-- client/client_handlers.go | 12 ++++++------ 3 files changed, 22 insertions(+), 11 deletions(-) diff --git a/client/client.go b/client/client.go index 3040ca3..e278c38 100644 --- a/client/client.go +++ b/client/client.go @@ -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 +} diff --git a/client/client_handler.go b/client/client_handler.go index 7e0ce21..f0d2096 100644 --- a/client/client_handler.go +++ b/client/client_handler.go @@ -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 } diff --git a/client/client_handlers.go b/client/client_handlers.go index f872129..1974f5e 100644 --- a/client/client_handlers.go +++ b/client/client_handlers.go @@ -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 }