ing
This commit is contained in:
parent
d430a13a76
commit
24532a16bb
|
@ -3,13 +3,14 @@ package client
|
||||||
import (
|
import (
|
||||||
"git.loafle.net/commons_go/rpc"
|
"git.loafle.net/commons_go/rpc"
|
||||||
"git.loafle.net/commons_go/rpc/client"
|
"git.loafle.net/commons_go/rpc/client"
|
||||||
|
crcrwf "git.loafle.net/commons_go/rpc/client/rwc/websocket/fasthttp"
|
||||||
)
|
)
|
||||||
|
|
||||||
func New(addr string, registry rpc.Registry) client.Client {
|
func New(addr string, registry rpc.Registry) client.Client {
|
||||||
|
|
||||||
ch := NewClientHandler(addr, registry)
|
ch := NewClientHandler(addr, registry)
|
||||||
|
cRWCHandler := crcrwf.New()
|
||||||
c := client.New(ch)
|
c := client.New(ch, cRWCHandler)
|
||||||
|
|
||||||
return c
|
return c
|
||||||
}
|
}
|
||||||
|
|
36
client/client_rwc_handlers.go
Normal file
36
client/client_rwc_handlers.go
Normal file
|
@ -0,0 +1,36 @@
|
||||||
|
package client
|
||||||
|
|
||||||
|
import (
|
||||||
|
"fmt"
|
||||||
|
"net/http"
|
||||||
|
"net/url"
|
||||||
|
|
||||||
|
crcrwf "git.loafle.net/commons_go/rpc/client/rwc/websocket/fasthttp"
|
||||||
|
"git.loafle.net/commons_go/websocket_fasthttp/websocket"
|
||||||
|
)
|
||||||
|
|
||||||
|
type ClientReadWriteCloseHandlers struct {
|
||||||
|
crcrwf.ClientReadWriteCloseHandlers
|
||||||
|
|
||||||
|
Scheme string
|
||||||
|
Host string
|
||||||
|
Path string
|
||||||
|
}
|
||||||
|
|
||||||
|
func (crwch *ClientReadWriteCloseHandlers) Connect() (interface{}, error) {
|
||||||
|
u := url.URL{
|
||||||
|
Scheme: crwch.Scheme,
|
||||||
|
Host: crwch.Host,
|
||||||
|
Path: crwch.Path,
|
||||||
|
}
|
||||||
|
var reqHeader http.Header
|
||||||
|
reqHeader.Add("", "")
|
||||||
|
|
||||||
|
conn, res, err := websocket.DefaultDialer.Dial(u.String(), reqHeader)
|
||||||
|
|
||||||
|
return nil, fmt.Errorf("RPC Client RWC Handler: ClientHandlers method[Connect] is not implement")
|
||||||
|
}
|
||||||
|
|
||||||
|
func (crwch *ClientReadWriteCloseHandlers) Validate() {
|
||||||
|
|
||||||
|
}
|
Loading…
Reference in New Issue
Block a user